fastapi-crudrouter
fastapi-crudrouter copied to clipboard
modified tortoise _get_one route
- Simplification of the _get_one route: use of the get method provided by tortoise instead of using filter. The 404 is still raised if the item does not exist Note that it changes the error message
This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.
🔍 Inspect: https://vercel.com/flortz/fastapi-crudrouter/HGPPRrQ1qyUAZhgGVYciMPgDvbiM
✅ Preview: https://fastapi-crudrouter-git-fork-gabriel2409-feature-t-b5e00f-flortz.vercel.app
Hi @Gabriel2409! Sorry for the delay in review! Thanks for this 🚀
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Updated |
|---|---|---|---|
| fastapi-crudrouter | ✅ Ready (Inspect) | Visit Preview | Jun 3, 2022 at 6:59AM (UTC) |
I added a commit to catch the tortoise DoesNotExist exception. However, I think this solution is not entirely satisfactory as the exception is caught even if add_exception_handler was set to True when registering tortoise. That means your custom error message will always be displayed, which might conflict with custom routes not created with fastapi crudrouter.