Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Custom exception handling #39

Closed
troyswanson opened this issue Feb 18, 2019 · 4 comments
Closed

Custom exception handling #39

troyswanson opened this issue Feb 18, 2019 · 4 comments

Comments

@troyswanson
Copy link

Starlette has the notion of custom error handlers that look like routes, which are invoked when an HTTPException is raised inside a regular route. Is this a thing that can be done in FastAPI?

Related documentation:

@tiangolo
Copy link
Owner

Yes, you can do the same.

I just updated the docs to clarify that a bit more: https://fastapi.tiangolo.com/tutorial/handling-errors/

@troyswanson
Copy link
Author

Wow, thanks so much for the quick response!

@tiangolo
Copy link
Owner

You're welcome! 🎉

@tiangolo tiangolo changed the title [QUESTION] Custom exception handling Custom exception handling Feb 24, 2023
@tiangolo tiangolo reopened this Feb 28, 2023
@github-actions
Copy link
Contributor

Assuming the original need was handled, this will be automatically closed now. But feel free to add more comments or create new issues or PRs.

@tiangolo tiangolo reopened this Feb 28, 2023
Repository owner locked and limited conversation to collaborators Feb 28, 2023
@tiangolo tiangolo converted this issue into discussion #8223 Feb 28, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

No branches or pull requests

2 participants