You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/09/30 14:09:56 UTC
[GitHub] [iceberg] Fokko opened a new pull request, #5897: Python: Catch ValidationError on invalid REST response
Fokko opened a new pull request, #5897:
URL: https://github.com/apache/iceberg/pull/5897
If an implementation of the rest catalog returns something different than we expect, we just propagate the ValidationError, which subclasses the ValueError. When using the CLI, it will tell you that the URI is not set, but actually it is, it is just invalid.
This will return the json to the user, and also tell what's wrong with the response. Hopefully users won't see this ever :)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
[GitHub] [iceberg] rdblue commented on a diff in pull request #5897: Python: Catch ValidationError on invalid REST response
Posted by GitBox <gi...@apache.org>.
rdblue commented on code in PR #5897:
URL: https://github.com/apache/iceberg/pull/5897#discussion_r989541079
##########
python/tests/catalog/test_rest.py:
##########
@@ -113,6 +114,20 @@ def test_token_401(rest_mock: Mocker):
assert message in str(e.value)
+def test_token_401_oauth_error(rest_mock: Mocker):
+ """This test returns a OAuth error instead of an OpenAPI error"""
+ message = """RESTError 401: Received unexpected JSON Payload: {"error": "invalid_client", "error_description": "Invalid credentials"}, errors: <bound method ValidationError.errors of ValidationError(model='ErrorResponse', errors=[{'loc': ('error',), 'msg': 'value is not a valid dict', 'type': 'type_error.dict'}])>"""
Review Comment:
It looks like you need to call `e.errors()` to avoid this in the message: `errors: <bound method ValidationError.errors of ValidationError(...)>`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
[GitHub] [iceberg] Fokko merged pull request #5897: Python: Catch ValidationError on invalid REST response
Posted by GitBox <gi...@apache.org>.
Fokko merged PR #5897:
URL: https://github.com/apache/iceberg/pull/5897
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org