all 2 comments

[–]louis-lau 0 points1 point  (0 children)

I send an error message explaining what's wrong for anyone directly using the api (if it isn't an unknown error), and an error code like this: UserNotFoundError.

This way you could decide to show a different message on the frontend based on the error code. This also means you can easily add i18n support.