1

I work on a spring kotlin backend which has an angular and a mobile frontend. We are currently working on error handling and we decided that the backend should return an error code, a general message (probably in english) and parameters for the frontends to build their own, localized messages.

However, we are not sure in what way we should model the "parameters" for the message. It could be just a map or a more generic ErrorDetails interface with some implementations for specific errors.

On the angular side we plan to use transloco for translation if that is relevant.

I did not find many resources on this specific topic and maybe someone has some valuable tips for me.

3
  • 2
    Problem Details for HTTP APIs Commented Jun 5 at 11:13
  • 1
    Just to note that RFC 7807 is superseded by rfc-editor.org/rfc/rfc9457 which adds more clarification on how to describe individual errors Commented Jun 5 at 11:50
  • Thanks, I was not aware of RFC 7807. I am a bit confused about the type: URI field. In our case we would like to use actual error codes, which is apparently possible but not really encouraged by the RFC. github.com/ietf-wg-httpapi/rfc7807bis/issues/11. This is currently the only thing keeping me away from it. Is it okay to use it like that, or should we then better move to a custom ApiErrorType?
    – Christian
    Commented Jun 5 at 16:02

0

Browse other questions tagged or ask your own question.