程序包 cn.taketoday.web
类 ResponseStatusException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
cn.taketoday.core.NestedRuntimeException
cn.taketoday.web.ErrorResponseException
cn.taketoday.web.ResponseStatusException
- 所有已实现的接口:
HttpStatusCodeProvider,ErrorResponse,Serializable
- 直接已知子类:
InternalServerException,MethodNotAllowedException,NotAcceptableStatusException,UnsupportedMediaTypeStatusException
Subclass of
ErrorResponseException that accepts a "reason" and maps
it to the "detail" property of ProblemDetail.- 从以下版本开始:
- 3.0.1
- 作者:
- Rossen Stoyanchev, Juergen Hoeller, TODAY 2021/5/6 19:16
- 另请参阅:
-
字段概要
字段 -
构造器概要
构造器构造器说明ResponseStatusException(int rawStatusCode, String reason, Throwable cause) Constructor with a response status and a reason to add to the exception message as explanation, as well as a nested exception.Constructor with a response status.ResponseStatusException(HttpStatusCode status, String reason) Constructor with a response status and a reason to add to the exception message as explanation.ResponseStatusException(HttpStatusCode status, String reason, Throwable cause) Constructor with a response status and a reason to add to the exception message as explanation, as well as a nested exception. -
方法概要
修饰符和类型方法说明Return headers to add to the error response, e.g.The reason explaining the exception (potentiallynullor empty).从类继承的方法 cn.taketoday.web.ErrorResponseException
getBody, getStatusCode, setDetail, setInstance, setTitle, setType从类继承的方法 cn.taketoday.core.NestedRuntimeException
contains, getMostSpecificCause, getNestedMessage, getRootCause
-
字段详细资料
-
serialVersionUID
private static final long serialVersionUID- 另请参阅:
-
reason
-
-
构造器详细资料
-
ResponseStatusException
Constructor with a response status.- 参数:
status- the HTTP status (required)
-
ResponseStatusException
Constructor with a response status and a reason to add to the exception message as explanation.- 参数:
status- the HTTP status (required)reason- the associated reason (optional)
-
ResponseStatusException
public ResponseStatusException(int rawStatusCode, @Nullable String reason, @Nullable Throwable cause) Constructor with a response status and a reason to add to the exception message as explanation, as well as a nested exception.- 参数:
rawStatusCode- the HTTP status code valuereason- the associated reason (optional)cause- a nested exception (optional)
-
ResponseStatusException
public ResponseStatusException(HttpStatusCode status, @Nullable String reason, @Nullable Throwable cause) Constructor with a response status and a reason to add to the exception message as explanation, as well as a nested exception.- 参数:
status- the HTTP status (required)reason- the associated reason (optional)cause- a nested exception (optional)
-
-
方法详细资料
-
getReason
The reason explaining the exception (potentiallynullor empty). -
getHeaders
Return headers to add to the error response, e.g. "Allow", "Accept", etc.By default, delegates to
HttpHeaders.empty()for backwards compatibility.- 指定者:
getHeaders在接口中ErrorResponse- 覆盖:
getHeaders在类中ErrorResponseException
-
getMessage
- 覆盖:
getMessage在类中ErrorResponseException
-