Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Maps Spring Boot 3 exceptions to RFC 9457 Problem Details responses, preserving any existing legacy error contract.
79% 100%+21 ptsof test cases passed
Passed 24 of 24 test cases with the skill, and 19 of 24 without it.
This test ran on v3. v4 is the current version and hasn’t been tested on gemini-3.6-flash yet.
3 of 3 safety checks passed
Not used yet
Inspect existing advice, security entry points and API tests first. Keep one error policy per API. Success DTOs or success envelopes can coexist with Problem Details errors: RFC 9457 specifies errors, not success representations.
For an API using Problem Details, enable Spring's built-in MVC exception handling:
spring:
mvc:
problemdetails:
enabled: true
For WebFlux use spring.webflux.problemdetails.enabled and reactive exception handling;
the servlet templates below are not WebFlux handlers.
Use the compiled DomainException together with ProblemDetailExceptionHandler. The handler maps all subclasses using their declared status and stable error code:
Each public class has its own file. These are API-facing exceptions with HTTP status metadata; for a framework-free domain, keep domain exceptions independent and map them in the web adapter. Do not expose arbitrary persistence or infrastructure exception messages.
The advice extends ResponseEntityExceptionHandler to preserve Spring's handling of framework
exceptions. Validation returns 400 with field violations; unexpected failures return a generic
500 while retaining the full exception only in server logs. Keep nullable validation messages safe.
Filter-level authentication failures need an AuthenticationEntryPoint; authorization failures
need an AccessDeniedHandler. Controller advice does not cover the security filter chain.
Method-security (@PreAuthorize) denials are the opposite case: AccessDeniedException is thrown
Next to this one in the catalogue, plus more from the same author.