{"modulePath":"github.com/databricks/databricks-sql-go/v2","version":"v2.0.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package errors\n\n## Variables\n\n```go\nvar RetryableError error = errors.New(\"Retryable Error\")\n```\nvalue to use with errors.Is() to determine if an error chain contains a retryable error\n\n## Functions\n\n```go\nfunc NewBadConnectionError(err error) error\n```\n\n```go\nfunc NewDriverError(ctx context.Context, msg string, err error) *driverError\n```\n\n```go\nfunc NewExecutionError(ctx context.Context, msg string, err error, opStatusResp *cli_service.TGetOperationStatusResp) *executionError\n```\n\n```go\nfunc NewExecutionErrorWithState(ctx context.Context, msg string, err error, queryId, sqlState string) *executionError\n```\nNewExecutionErrorWithState 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.\n\n```go\nfunc NewRequestError(ctx context.Context, msg string, err error) *requestError\n```\n\n```go\nfunc NewRetryableError(err error, retryAfterHdr string) error\n```\n\n```go\nfunc NewReydenThriftUnsupportedError(msg string) error\n```\nNewReydenThriftUnsupportedError creates a marker error for Reyden warehouse rejection of Thrift protocol (SQLSTATE KP001).\n\n```go\nfunc WrapErr(err error, msg string) error\n```\nwraps an error and adds trace if not already present\n\n```go\nfunc WrapErrf(err error, format string, args ...interface{}) error\n```\nadds a stack trace if not already present\n\n## Types\n\n```go\ntype ErrorCategory string\n```\nErrorCategory is a source-declared classification for a driver error, so telemetry can read the category directly instead of inferring it from the error message.\n\n```go\nconst (\n\tCategoryTimeout              ErrorCategory = \"timeout\"\n\tCategoryCancelled            ErrorCategory = \"cancelled\"\n\tCategoryConnectionError      ErrorCategory = \"connection_error\"\n\tCategoryAuthError            ErrorCategory = \"auth_error\"\n\tCategoryPermissionError      ErrorCategory = \"permission_error\"\n\tCategoryNotFound             ErrorCategory = \"not_found\"\n\tCategorySyntaxError          ErrorCategory = \"syntax_error\"\n\tCategoryInvalidRequest       ErrorCategory = \"invalid_request\"\n\tCategoryGeneric              ErrorCategory = \"error\"\n\tCategoryChunkDownload        ErrorCategory = \"chunk_download_error\"\n\tCategoryDecompression        ErrorCategory = \"decompression_error\"\n\tCategoryArrowSchemaParsing   ErrorCategory = \"arrow_schema_parsing_error\"\n\tCategoryResultSet            ErrorCategory = \"result_set_error\"\n\tCategoryUnsupportedOperation ErrorCategory = \"unsupported_operation\"\n\tCategoryRateLimitExceeded    ErrorCategory = \"rate_limit_exceeded\"\n\tCategorySSLHandshake         ErrorCategory = \"ssl_handshake_error\"\n\tCategoryStatementTimeout     ErrorCategory = \"statement_execution_timeout\"\n\tCategoryExecuteStatement     ErrorCategory = \"execute_statement_failed\"\n\tCategoryStatementCancelled   ErrorCategory = \"execute_statement_cancelled\"\n\tCategorySessionClosed        ErrorCategory = \"session_closed\"\n\tCategoryStatementClosed      ErrorCategory = \"statement_closed\"\n)\n```\n\n```go\nfunc CategoryFromError(err error) ErrorCategory\n```\nCategoryFromError 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.\n\n","path":"github.com/databricks/databricks-sql-go/v2/internal/errors","name":"errors","synopsis":"","isRedistributable":true}
