errors

package
v1.15.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 28, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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 NewBadConnectionError(err error) error

func NewDriverError

func NewDriverError(ctx context.Context, msg string, err error) *driverError

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 NewRequestError(ctx context.Context, msg string, err error) *requestError

func NewRetryableError

func NewRetryableError(err error, retryAfterHdr string) error

func WrapErr

func WrapErr(err error, msg string) error

wraps an error and adds trace if not already present

func WrapErrf

func WrapErrf(err error, format string, args ...interface{}) error

adds a stack trace if not already present

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL