You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Updated driver error handling to standardize on three error types:
driver error (DBDriverError), request error (DBRequestError), and sql
execution error (DBExecutionError). All three types have accessors for
stack trace, correlation id, and connection id. DBExecutionError also
has accessors for query Id and sql state.
The example in examples/error shows how to use errors.Is() and
errors.As() to work with the error chain to determine error type and
extract the state.
---------
Signed-off-by: Matthew Kim <11141331+mattdeekay@users.noreply.github.com>
Signed-off-by: Raymond Cypher <raymond.cypher@databricks.com>
Co-authored-by: Matthew Kim <11141331+mattdeekay@users.noreply.github.com>
Copy file name to clipboardExpand all lines: doc.go
+46Lines changed: 46 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -144,6 +144,52 @@ The result log may look like this:
144
144
145
145
{"level":"debug","connId":"01ed6545-5669-1ec7-8c7e-6d8a1ea0ab16","corrId":"workflow-example","queryId":"01ed6545-57cc-188a-bfc5-d9c0eaf8e189","time":1668558402,"message":"Run Main elapsed time: 1.298712292s"}
146
146
147
+
# Errors
148
+
149
+
There are three error types exposed via dbsql/errors
150
+
151
+
DBDriverError - An error in the go driver. Example: unimplemented functionality, invalid driver state, errors processing a server response, etc.
152
+
153
+
DBRequestError - An error that is caused by an invalid request. Example: permission denied, invalid http path or other connection parameter, resource not available, etc.
154
+
155
+
DBExecutionError - Any error that occurs after the SQL statement has been accepted such as a SQL syntax error, missing table, etc.
156
+
157
+
Each type has a corresponding sentinel value which can be used with errors.Is() to determine if one of the types is present in an error chain.
0 commit comments