InseeFrLab / onyxia-api

REST API of Onyxia
https://onyxia.sh
MIT License
23 stars 28 forks source link

Implement Problem Details for HTTP APIs (RFC 9457) for api errors #495

Open johnksv opened 1 month ago

johnksv commented 1 month ago

The API should return more descriptive errors, rather than just plain status code errors, such that the frontend can display this information in a more user friendly (and descriptive) manner.

A suggestion is to implement the well known RFC 9457 standard for this, as documented here: https://datatracker.ietf.org/doc/html/rfc9457 Spring (and other frameworks) also has out-of-the-box support for this, e.g.: https://docs.spring.io/spring-framework/reference/web/webmvc/mvc-ann-rest-exceptions.html

As discussed in community meeting in August.

trygu commented 1 month ago

This one, I think is quite important. Especially when more people in our office create services, and we have policy systems like Kyverno installed. It can be a bit time consuming to debug errors. So I vote for this.

olevitt commented 1 month ago

I started work on this in #504.
Feel free to give feedback or contribute to this. My understanding of this is that the current state of the PR already handles generic exceptions. For more details we should create and throw corresponding exceptions in the controllers