r/SpringBoot • • Feb 07 '26

Question Error responses for REST API

Do you implement RFC 9457 in your error responses? I saw that Spring provides an abstraction for this with ProblemDetail, it looks good but not many people are using it.

12 Upvotes

15 comments sorted by

View all comments

Show parent comment

6

u/rl_085 Feb 07 '26

I agree about the security issue of providing detailed error messages, but I see the benefit for the client in standardizing the fields returned in an error response.

1

u/Winnin9 Feb 07 '26

Usually in my apps , I use a universal success and error response service using generic classes and pretty much the responses are predictable for any service consuming them. I have created a special service to facilitate the easily creation of responses .