-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Enhancement] Improve error handling in python SDK #799
base: main
Are you sure you want to change the base?
Conversation
e4098e1
to
bfe9b0b
Compare
bfe9b0b
to
15940f2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @dsculptor.
Let's extend this with one more change. In particular, I want to ensure that any error that is not parsed by any of the current error parsers is still handled in a graceful manner. To do this, let's implement a new error parser that is a catch-all error parser that just sets the entire response body as the message. That way, we never need to use this message in the error directly, as this error parser will always succeed. However, we can still log a message saying that we were unable to parse the error and fell back to this catch-all case.
@@ -38,7 +38,7 @@ def _unknown_error(response: requests.Response) -> str: | |||
return ( | |||
'This is likely a bug in the Databricks SDK for Python or the underlying ' | |||
'API. Please report this issue with the following debugging information to the SDK issue tracker at ' | |||
f'https://github.com/databricks/databricks-sdk-go/issues. Request log:```{request_log}```') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops, nice catch!
15940f2
to
094addf
Compare
If integration tests don't run automatically, an authorized user can run them manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
Test Details: go/deco-tests/12007089624 |
Changes
This PR adds a catch-all error handler from API responses in the Databricks SDK for Python.
Also contains minor fixes for error messages.
Tests
make test
run locallymake fmt
appliedSame as: #767