Documentation
¶
Index ¶
- Variables
- func NewBadConnectionError(err error) error
- func NewDriverError(ctx context.Context, msg string, err error) *driverError
- func NewExecutionError(ctx context.Context, msg string, err error, ...) *executionError
- func NewExecutionErrorWithState(ctx context.Context, msg string, err error, queryId, sqlState string) *executionError
- func NewRequestError(ctx context.Context, msg string, err error) *requestError
- func NewRetryableError(err error, retryAfterHdr string) error
- func WrapErr(err error, msg string) error
- func WrapErrf(err error, format string, args ...interface{}) error
- type ErrorCategory
Constants ¶
This section is empty.
Variables ¶
var RetryableError error = errors.New("Retryable Error")
value to use with errors.Is() to determine if an error chain contains a retryable error
Functions ¶
func NewBadConnectionError ¶ added in v1.5.0
func NewExecutionError ¶
func NewExecutionError(ctx context.Context, msg string, err error, opStatusResp *cli_service.TGetOperationStatusResp) *executionError
func NewExecutionErrorWithState ¶ added in v1.15.0
func NewExecutionErrorWithState(ctx context.Context, msg string, err error, queryId, sqlState string) *executionError
NewExecutionErrorWithState builds an execution error from an already-extracted queryId and sqlState, for backends that don't have a Thrift TGetOperationStatusResp (e.g. the kernel backend, which carries both in its own KernelError). Same shape as NewExecutionError otherwise. An empty queryId falls back to the ctx value, so a caller that only has the ctx id (or none) still behaves like NewExecutionError.
func NewRequestError ¶
func NewRetryableError ¶
Types ¶
type ErrorCategory ¶ added in v1.15.0
type ErrorCategory string
ErrorCategory is a source-declared classification for a driver error, so telemetry can read the category directly instead of inferring it from the error message.
const ( CategoryTimeout ErrorCategory = "timeout" CategoryCancelled ErrorCategory = "cancelled" CategoryConnectionError ErrorCategory = "connection_error" CategoryAuthError ErrorCategory = "auth_error" CategoryPermissionError ErrorCategory = "permission_error" CategoryNotFound ErrorCategory = "not_found" CategorySyntaxError ErrorCategory = "syntax_error" CategoryInvalidRequest ErrorCategory = "invalid_request" CategoryGeneric ErrorCategory = "error" CategoryChunkDownload ErrorCategory = "chunk_download_error" CategoryDecompression ErrorCategory = "decompression_error" CategoryArrowSchemaParsing ErrorCategory = "arrow_schema_parsing_error" CategoryResultSet ErrorCategory = "result_set_error" CategoryUnsupportedOperation ErrorCategory = "unsupported_operation" CategoryRateLimitExceeded ErrorCategory = "rate_limit_exceeded" CategorySSLHandshake ErrorCategory = "ssl_handshake_error" CategoryStatementTimeout ErrorCategory = "statement_execution_timeout" CategoryExecuteStatement ErrorCategory = "execute_statement_failed" CategoryStatementCancelled ErrorCategory = "execute_statement_cancelled" CategorySessionClosed ErrorCategory = "session_closed" CategoryStatementClosed ErrorCategory = "statement_closed" )
func CategoryFromError ¶ added in v1.15.0
func CategoryFromError(err error) ErrorCategory
CategoryFromError returns the innermost (deepest) non-empty category in the error chain, so a tag on an outer wrapper never masks the more specific one at the source. Handles both single-error and tree-shaped (errors.Join / multiple %w) Unwrap chains.