Companion code for "Global Exception Handling with ProblemDetail (RFC 9457) in Spring Boot 4". Thirteen failures under five handling setups (Boot defaults, the Boot flag, a ResponseEntityExceptionHandler advice, advice plus an ErrorController, a catch-all ordered first), validation errors, i18n, content negotiation, Security's 401/403, silent 500s and decoding on the client. 16 tests pin the behaviour. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01C3TETMrqVUWeFkNtz3Jbo3
19 lines
676 B
Plaintext
19 lines
676 B
Plaintext
# Profile: errors (ProblemDetailErrorController only - no @ControllerAdvice, no Security handlers)
|
|
|
|
$ curl /admin/orders
|
|
HTTP/1.1 401
|
|
WWW-Authenticate: Basic realm="Realm", charset="UTF-8"
|
|
Content-Type: application/problem+json
|
|
{"detail":"Unauthorized","instance":"/admin/orders","status":401,"title":"Unauthorized"}
|
|
|
|
$ curl -u user:user /admin/orders
|
|
HTTP/1.1 403
|
|
Content-Type: application/problem+json
|
|
{"detail":"Forbidden","instance":"/admin/orders","status":403,"title":"Forbidden"}
|
|
|
|
$ curl /orders/999
|
|
HTTP/1.1 500
|
|
Content-Type: application/problem+json
|
|
{"detail":"An unexpected error occurred.","instance":"/orders/999","status":500,"title":"Internal Server Error"}
|
|
|