Repository navigation
Structured *clickhouse.Exception (or clickhouse.Error interface) on the HTTP protocol
#1870
swvooda
started this conversation in
Feature requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
When the HTTP protocol returns an error originating from a ClickHouse
DB::Exception, the driver surfaces it as an ad-hocfmt.Errorfstring. Callers that need to branch on the ClickHouse error code (e.g.60 UNKNOWN_TABLE,159 TIMEOUT_EXCEEDED,241 MEMORY_LIMIT_EXCEEDED) are forced to regex-parse path on HTTP.Current behavior (HTTP)
On a query that fails server-side, callers receive an error whose only carrier of structured data is the message string:
errors.As(err, &clickhouse.Exception{})does not match — the HTTP path constructs the error atconn_http.go:598viafmt.Errorf(...), so the typed*clickhouse.Exceptionthat Native returns is lost. This was confirmed by @kavirajk in the #1670 thread.Expected behavior
Have structured error types like the other protocols do currently.
All reactions