WrapError creates a structured error that wraps an existing cause error. Use this to add error code, location, and SQL context to low-level errors (e.g., I/O errors, unexpected runtime panics) so they integrate with the GoSQLX error handling pipeline. Parameters: - code: ErrorCode classifying the e
(code ErrorCode, message string, location models.Location, sql string, cause error)
| 218 | // - sql: Full SQL source used to generate visual context |
| 219 | // - cause: Underlying error being wrapped (accessible via errors.Is / errors.As) |
| 220 | func WrapError(code ErrorCode, message string, location models.Location, sql string, cause error) *Error { |
| 221 | return NewError(code, message, location).WithContext(sql, 1).WithCause(cause) |
| 222 | } |
| 223 | |
| 224 | // Tokenizer DoS Protection Errors (E1006-E1008) |
| 225 |