onyxia-api icon indicating copy to clipboard operation
onyxia-api copied to clipboard

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

Open johnksv opened this issue 1 year ago • 2 comments

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.

johnksv avatar Sep 17 '24 07:09 johnksv

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.

trygu avatar Sep 20 '24 14:09 trygu

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

olevitt avatar Sep 27 '24 13:09 olevitt