Add problem-details: global exception handling with RFC 9457
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
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env bash
|
||||
# The error controller on its own (profile errors, no advice): Security's sendError() responses
|
||||
# land on /error too, so they become problems without custom Security handlers.
|
||||
# -> docs/output/errors-only.txt
|
||||
set -uo pipefail
|
||||
source "$(dirname "$0")/env.sh"
|
||||
"$MODULE_DIR/scripts/run.sh" errors || exit 1
|
||||
{
|
||||
echo "# Profile: errors (ProblemDetailErrorController only - no @ControllerAdvice, no Security handlers)"
|
||||
echo
|
||||
for args in "/admin/orders" "-u user:user /admin/orders" "/orders/999"; do
|
||||
echo "\$ curl $args"
|
||||
curl -s -i $(echo "$args" | sed "s#/#$BASE/#") | grep -iE '^HTTP|^content-type|^www-authenticate|^\{' | tr -d '\r'
|
||||
echo
|
||||
done
|
||||
} > "$OUT/errors-only.txt"
|
||||
"$MODULE_DIR/scripts/stop.sh"
|
||||
cat "$OUT/errors-only.txt"
|
||||
Reference in New Issue
Block a user