Skip to content
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: Add not_found custom error message #391

Open
noamsto opened this issue Feb 18, 2025 · 0 comments
Open

Enhancement: Add not_found custom error message #391

noamsto opened this issue Feb 18, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@noamsto
Copy link
Contributor

noamsto commented Feb 18, 2025

Summary

When doing repository.get() there is an option to set custom message when various error occur, but there is no option for NotFoundError.
It will be very convenient if this will be added.

Basic Example

        org = await organizations_service.get_one_or_none(Organization.id == organization_id)
        if not org:
            raise NotFoundException("Organization not found")

The above will become:

        org = await organizations_service.get(
            organization_id, error_messages=ErrorMessages(not_found="Organization not found")
        )

Drawbacks and Impact

No response

Unresolved questions

No response

@noamsto noamsto added the enhancement New feature or request label Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant