Skip to content

Conversation

@PastelStorm
Copy link
Contributor

No description provided.

def wrap_error(e: Exception) -> HTTPException:
if isinstance(e, ingest_errors.UserAuthError):
return UserAuthError(e)
elif isinstance(e, ingest_errors.UnprocessableEntityError):
Copy link
Contributor

Choose a reason for hiding this comment

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

The definition has to be added in the lib in order to use it here

Copy link
Contributor

@six5532one six5532one Jun 24, 2025

Choose a reason for hiding this comment

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

Will the wrapped code be raising HTTPException? If so, there's the option to defer definingingest_errors.UnprocessableEntityError.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am wrapping all internal plugin errors in HTTPException, so yes they should always raise a properly configured FastAPI HTTPException

@PastelStorm PastelStorm merged commit d2d4373 into main Jun 24, 2025
9 checks passed
@PastelStorm PastelStorm deleted the evoss/add-422-handler branch June 24, 2025 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants