FanvidDB / fanviddb-server

Server of the fanviddb
Other
0 stars 1 forks source link

Convert API responses to use identifier strings instead of translated values #52

Open sandalwoodbox opened 3 years ago

sandalwoodbox commented 3 years ago

Currently, there are three api errors that can be translated:

However, these translations would probably never be seen by the end user, and most API errors (i.e. validation errors from pydantic or errors from fastapi-users) are not translatable server-side (because they're generated by third-party code and there isn't a mechanism to inject translation logic into it). Instead, we translate them client-side based on the error identifier provided.

We should standardize on this behavior; our API errors should match either fastapi-users or pydantic structures, and be handled similarly in terms of translation (where applicable - i.e. 404 errors are already handled differently just based on status code.)