Skip to content

Commit dfc1b83

Browse files
committed
Polish "Fix default strategy description of ProblemDetail error codes"
See gh-32446
1 parent 302c24a commit dfc1b83

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

framework-docs/modules/ROOT/pages/web/webmvc/mvc-ann-rest-exceptions.adoc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,16 @@ It is a common requirement to customize and internationalize error response deta
7474
It is also good practice to customize the problem details for Spring MVC exceptions
7575
to avoid revealing implementation details. This section describes the support for that.
7676

77-
An `ErrorResponse` exposes message codes for "type" and "title". `ResponseEntityExceptionHandler` resolves
77+
An `ErrorResponse` exposes message codes for "type", "title", and "detail", as well as
78+
message code arguments for the "detail" field. `ResponseEntityExceptionHandler` resolves
7879
these through a xref:core/beans/context-introduction.adoc#context-functionality-messagesource[MessageSource]
7980
and updates the corresponding `ProblemDetail` fields accordingly.
8081

81-
The default strategy for message codes follows the pattern:
82+
The default strategy for message codes is as follows:
8283

83-
`problemDetail.[type|title].[fully qualified exception class name]`
84+
* "type": `problemDetail.type.[fully qualified exception class name]`
85+
* "title": `problemDetail.title.[fully qualified exception class name]`
86+
* "detail": `problemDetail.[fully qualified exception class name][suffix]`
8487

8588
An `ErrorResponse` may expose more than one message code, typically adding a suffix
8689
to the default message code. The table below lists message codes, and arguments for

0 commit comments

Comments
 (0)