Card 07/ 07

RecapDifficulty: Advanced1 min

What This Topic Established

A custom, unchecked exception names one failure; @ExceptionHandler maps it to one response. @RestControllerAdvice moves that handler outside any one controller, so it answers every controller that throws the same exception — verified across two unrelated controllers.

Spring matches @ExceptionHandler methods by the most specific exception type, never by declaration order — verified: a generic handler declared first still lost to a specific one declared after it. A well-formed error body carries more than a message: a timestamp, the status, and the path, so a client and a server-side log can be lined up against each other.