-
Notifications
You must be signed in to change notification settings - Fork 390
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
refactor: remove API v1 responses exception captures #4904
refactor: remove API v1 responses exception captures #4904
Conversation
@@ -99,10 +100,10 @@ async def _upsert_records_suggestions( | |||
try: | |||
SuggestionCreateValidator(suggestion_create).validate_for(question.parsed_settings, record) | |||
upsert_many_suggestions.append(dict(**suggestion_create.dict(), record_id=record.id)) | |||
except ValueError as ex: | |||
except (UnprocessableEntityError, ValueError) as ex: |
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.
@frascuchon once that everything is refactored I will change these kind of lines to be something like:
except (UnprocessableEntityError, ValueError) as ex: | |
except UnprocessableEntityError as ex: |
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.
Okay but the raised error shouldn't be UnprocessableEntity?
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.
Yes, it's changed to raise UnprocessableEntityError
in another PR: https://github.com/argilla-io/argilla/pull/4912/files#diff-8b6a4a23212d32e0db897e0fd54b482d2246be5f98c24915ce4f93923f14e8d5R107
…emove-api-v1-responses-exceptions
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## refactor/improve-api-v1-error-handling #4904 +/- ##
==========================================================================
- Coverage 90.97% 90.97% -0.01%
==========================================================================
Files 206 206
Lines 10001 10000 -1
==========================================================================
- Hits 9098 9097 -1
Misses 903 903
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
b8847e9
into
refactor/improve-api-v1-error-handling
Description
This PR remove all exception capture blocks for API v1 responses handler.
Refs #4871
Type of change
(Please delete options that are not relevant. Remember to title the PR according to the type of change)
How Has This Been Tested
(Please describe the tests that you ran to verify your changes. And ideally, reference
tests
)Checklist