You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
this is quite confusing as it means that when enabling the ProblemDetails format, it is not used for every error but only for a subset, and the clients that call the API need to handle 2 different error formats.
A way to fix this in the app is to create a method that handles the extra errors
but this feels like a hack that shouldn't be necessary, as errors should always be returned in the same format from Spring Boot (regardless of the format selected).
I think this would probably be fixed by adding the method shown above inside the ResponseEntityExceptionHandler class, but this would break backward compatibility so I'm unsure if this should be released before the next major version release or if it can indeed be released in the current major version as a bug fix.
If you are happy with the approach I mentioned above I can create a PR for it.
The text was updated successfully, but these errors were encountered:
When using
ResponseEntityExceptionHandler
, by either creating a parent classor enabling
ProbleDetails
via the application configurationthe proper error format (i.e.,
ProbleDetails
) is used for some errors (e.g.400
)but when an
Exception
is thrown anywhere inside the code, which results in a500
error then the default Spring Boot error format is returned insteadthis is quite confusing as it means that when enabling the
ProblemDetails
format, it is not used for every error but only for a subset, and the clients that call the API need to handle 2 different error formats.A way to fix this in the app is to create a method that handles the extra errors
but this feels like a hack that shouldn't be necessary, as errors should always be returned in the same format from Spring Boot (regardless of the format selected).
I think this would probably be fixed by adding the method shown above inside the
ResponseEntityExceptionHandler
class, but this would break backward compatibility so I'm unsure if this should be released before the next major version release or if it can indeed be released in the current major version as a bug fix.If you are happy with the approach I mentioned above I can create a PR for it.
The text was updated successfully, but these errors were encountered: