Closed bewee closed 2 years ago
See https://github.com/tiangolo/fastapi/issues/518
:
Although it is kinda possible, they recommend to differentiate errors (where necessary for the front-end) by status code via exception.status
(or - if really necessary - by detail
text which we can get via exception.message
in the front-end). Although it is possible to use response models for errors, this would heavily blow up our code while not working in the generated docs wepbage nor in the generated REST Client, thus rendering it completely useless for us.
We should consider documenting errors via FastAPI's additional responses. If we are lucky, the auto-generated REST client should then enable us to differentiate between different errors in the frontend