Closed Master-Y0da closed 3 years ago
I have a frontend running with vue js...and backend with fastapi and tortoise. When I try this
get= await some_pydantic.from_queryset_single(Model.get(id=id))
If object not found prints this in console "tortoise.exceptions.DoesNotExist: Object does not exist"
How can I return that error as Json response ?...because it only appears on console...but frotend is getting a 500 error with no description.
use Model.get_or_none or see https://fastapi.tiangolo.com/tutorial/handling-errors/
Model.get_or_none
Thanks!!
I have a frontend running with vue js...and backend with fastapi and tortoise. When I try this
get= await some_pydantic.from_queryset_single(Model.get(id=id))
If object not found prints this in console "tortoise.exceptions.DoesNotExist: Object does not exist"
How can I return that error as Json response ?...because it only appears on console...but frotend is getting a 500 error with no description.