Skip to content

Python: Catch ValidationError on invalid REST response#5897

Merged
Fokko merged 2 commits intoapache:masterfrom
Fokko:fd-catch-validation-error
Oct 10, 2022
Merged

Python: Catch ValidationError on invalid REST response#5897
Fokko merged 2 commits intoapache:masterfrom
Fokko:fd-catch-validation-error

Conversation

@Fokko
Copy link
Contributor

@Fokko Fokko commented Sep 30, 2022

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 :)

Copy link
Contributor

@rdblue rdblue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine once the error message is fixed.

Fokko added 2 commits October 10, 2022 09:31
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.
@Fokko Fokko force-pushed the fd-catch-validation-error branch from bdb1b64 to 3b6c41d Compare October 10, 2022 07:35
@Fokko Fokko merged commit 46bf3b7 into apache:master Oct 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants