diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ab08169..478ca97d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Release History +## Unreleased +- Add an internal `ErrorCategory` type and category constants in `internal/errors` for telemetry error classification. No behavior change: the type is not read or attached anywhere yet (databricks/databricks-sql-go#414) + ## v1.14.0 (2026-07-13) - **Minimum Go version is now 1.25.0** (previously 1.20): the `go` directive was raised to 1.25.0 while clearing OSV-Scanner findings and updating dependencies. Consumers building with an older toolchain will need to upgrade Go (databricks/databricks-sql-go#368) - Fix panic in `InitThriftClient` when the endpoint URL is malformed: the thrift transport was type-asserted to `*thrift.THttpClient` before the error from `NewTHttpClientWithOptions` was checked, so a URL that fails to parse (nil transport) caused `interface conversion: thrift.TTransport is nil, not *thrift.THttpClient`; the error is now returned instead (databricks/databricks-sql-go#394) diff --git a/internal/errors/category.go b/internal/errors/category.go new file mode 100644 index 00000000..e191b3f7 --- /dev/null +++ b/internal/errors/category.go @@ -0,0 +1,30 @@ +package errors + +// 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. +type ErrorCategory string + +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" +)