{"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## Constants\n\n```go\nconst (\n\t// Driver errors\n\tErrNotImplemented                    = \"not implemented\"\n\tErrTransactionsNotSupported          = \"transactions are not supported\"\n\tErrReadQueryStatus                   = \"could not read query status\"\n\tErrSentinelTimeout                   = \"sentinel timed out waiting for operation to complete\"\n\tErrParametersNotSupported            = \"query parameters are not supported by this server\"\n\tErrMixedNamedAndPositionalParameters = \"named and positional parameters cannot be used simultaneously\"\n\n\t// Request error messages (connection, authentication, network error)\n\tErrCloseConnection = \"failed to close connection\"\n\tErrThriftClient    = \"error initializing thrift client\"\n\tErrInvalidURL      = \"invalid URL\"\n\n\tErrNoAuthenticationMethod = \"no authentication method set\"\n\tErrNoDefaultAuthenticator = \"unable to create default authenticator\"\n\tErrInvalidDSNFormat       = \"invalid DSN: invalid format\"\n\tErrInvalidDSNPort         = \"invalid DSN: invalid DSN port\"\n\tErrInvalidDSNPATIsEmpty   = \"invalid DSN: empty token\"\n\tErrBasicAuthNotSupported  = \"invalid DSN: basic auth not enabled\"\n\tErrInvalidDSNM2m          = \"invalid DSN: clientId and clientSecret params required\"\n\n\t// Execution error messages (query failure)\n\tErrQueryExecution = \"failed to execute query\"\n\tErrLinkExpired    = \"link expired\"\n)\n```\nError messages\n\n## Variables\n\n```go\nvar DatabricksError error = errors.New(\"Databricks Error\")\n```\nvalue to be used with errors.Is() to determine if an error chain contains any databricks error\n\n```go\nvar DriverError error = errors.New(\"Driver Error\")\n```\nvalue to be used with errors.Is() to determine if an error chain contains a driver error\n\n```go\nvar ErrInvalidKernelConfig error = errors.New(\"invalid kernel backend configuration\")\n```\nvalue to be used with errors.Is() to determine that a kernel-backend option was itself malformed (e.g. a bad proxy URL or client query timeout) — as opposed to unsupported (ErrNotSupportedByKernel) or a transient connect failure. The kernel path validates such options in the Go layer before handing them to the kernel's C ABI, where the failure would otherwise surface as an opaque wrapped string a caller can't branch on. Lets a caller distinguish \"fix your config\" from a retryable error instead of matching on message text.\n\n```go\nvar ErrKernelNotCompiled error = errors.New(\"the SEA-via-kernel backend is not compiled into this binary\")\n```\nvalue to be used with errors.Is() to determine that WithUseKernel(true) was set but the binary was built without the kernel backend compiled in (missing the \\`databricks\\_kernel\\` build tag / CGO\\_ENABLED=1). Lets a caller detect the build-mismatch case programmatically — the same detection mechanism as ErrNotSupportedByKernel — instead of matching on message text.\n\n```go\nvar ErrNotSupportedByKernel error = errors.New(\"not supported by the kernel backend\")\n```\nvalue to be used with errors.Is() to determine if an error is a kernel-backend \"option/feature not supported\" rejection. The kernel backend (WithUseKernel) rejects options it cannot yet honor rather than silently ignoring them; wrapping them all with this sentinel lets a caller detect the case programmatically (e.g. to fall back to the default Thrift backend) instead of matching on message text.\n\n```go\nvar ErrRequiresKernelBackend error = errors.New(\"requires the SEA-via-kernel backend\")\n```\nvalue to be used with errors.Is() to determine that a kernel-only option (e.g. WithClientQueryTimeout or WithKernelTrustedCerts) was set without WithUseKernel, so the default (Thrift) backend rejected it rather than connecting with a weaker-than-intended TLS trust store. This is the mirror of ErrNotSupportedByKernel — that sentinel means \"the kernel can't honor this option\"; this one means \"this option requires the kernel\". Lets a caller detect the case programmatically instead of matching on message text.\n\n```go\nvar ErrReydenThriftUnsupported error = errors.New(\"Reyden warehouse rejects legacy Thrift protocol\")\n```\nvalue to be used with errors.Is() to determine that a Reyden / Real-Time warehouse rejected the legacy Thrift protocol (SQLSTATE KP001). The connection layer transparently recovers by re-opening the session on the kernel backend. Subclassing under a distinct sentinel lets a caller detect this specific recoverable condition programmatically instead of matching on error message.\n\n```go\nvar ExecutionError error = errors.New(\"Execution Error\")\n```\nvalue to be used with errors.Is() to determine if an error chain contains an execution error\n\n```go\nvar RequestError error = errors.New(\"Request Error\")\n```\nvalue to be used with errors.Is() to determine if an error chain contains a request error\n\n## Functions\n\n```go\nfunc ErrInvalidOperationState(state string) string\n```\n\n```go\nfunc ErrUnexpectedOperationState(state string) string\n```\n\n```go\nfunc InvalidDSNFormat(param string, value string, expected string) string\n```\n\n## Types\n\n```go\ntype DBDriverError interface {\n\tDBError\n}\n```\nA fault that is caused by Databricks services\n\n```go\ntype DBError interface {\n\t// Descriptive message describing the error\n\tError() string\n\n\t// User specified id to track what happens under a request. Useful to track multiple connections in the same request.\n\t// Appears in log messages as field corrId.  See driverctx.NewContextWithCorrelationId()\n\tCorrelationId() string\n\n\t// Internal id to track what happens under a connection. Connections can be reused so this would track across queries.\n\t// Appears in log messages as field connId.\n\tConnectionId() string\n\n\t// Stack trace associated with the error.  May be nil.\n\tStackTrace() errors.StackTrace\n\n\t// Underlying causative error. May be nil.\n\tCause() error\n\n\tIsRetryable() bool\n\n\tRetryAfter() time.Duration\n}\n```\nBase interface for driver errors\n\n```go\ntype DBExecutionError interface {\n\tDBError\n\n\t// Internal id to track what happens under a query.\n\t// Appears in log messages as field queryId.\n\tQueryId() string\n\n\t// Optional portable error identifier across SQL engines.\n\t// See https://github.com/apache/spark/tree/master/core/src/main/resources/error#ansiiso-standard\n\tSqlState() string\n}\n```\nAny error that occurs after the SQL statement has been accepted (e.g. SQL syntax error).\n\n```go\ntype DBRequestError interface {\n\tDBError\n}\n```\nAn error that is caused by an invalid request. Example: permission denied, or the user tries to access a warehouse that doesn’t exist\n\n","path":"github.com/databricks/databricks-sql-go/v2/errors","name":"errors","synopsis":"","isRedistributable":true}
