From 11b31a0241e4dfe98d43380105f4c68b123bb431 Mon Sep 17 00:00:00 2001 From: Prathamesh Baviskar Date: Mon, 20 Jul 2026 08:21:36 +0000 Subject: [PATCH 1/2] Add ErrorCategory type and constants for telemetry error classification First step of PECOBLR-3537 (enrich go-driver telemetry codes). Adds an internal ErrorCategory string type in internal/errors with 21 category constants: the 9 values telemetry.classifyError already emits, preserved byte-for-byte, plus 12 new categories mirroring the JDBC driver's DatabricksDriverErrorCode taxonomy. No behavior change: the type is not read or attached anywhere yet. This is deliberately the smallest possible first PR; the mechanism (reading the category in classifyError) and tagging at error-source sites land in follow-up PRs. Signed-off-by: Prathamesh Baviskar --- CHANGELOG.md | 3 +++ internal/errors/category.go | 30 ++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 internal/errors/category.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ab08169..b95e4a4f 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` as the first step of enriching telemetry error classification (PECOBLR-3537). No behavior change yet: the type is not read or attached anywhere in this change (databricks/databricks-sql-go#XXXX) + ## 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" +) From 1d7741465589b247277c38c687d0ac4fa327a6c3 Mon Sep 17 00:00:00 2001 From: Prathamesh Baviskar Date: Mon, 20 Jul 2026 09:03:37 +0000 Subject: [PATCH 2/2] Backfill CHANGELOG entry with PR number #414 Replace the #XXXX placeholder with the real PR number and tighten the wording. Signed-off-by: Prathamesh Baviskar --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b95e4a4f..478ca97d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # Release History ## Unreleased -- Add an internal `ErrorCategory` type and category constants in `internal/errors` as the first step of enriching telemetry error classification (PECOBLR-3537). No behavior change yet: the type is not read or attached anywhere in this change (databricks/databricks-sql-go#XXXX) +- 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)