程序包 cn.taketoday.web
接口 ErrorResponse
- 所有超级接口:
HttpStatusCodeProvider
- 所有已知实现类:
AsyncRequestTimeoutException,DateParameterParsingException,ErrorResponseException,HandlerAdapterNotFoundException,HandlerNotFoundException,HttpMediaTypeException,HttpMediaTypeNotAcceptableException,HttpMediaTypeNotSupportedException,HttpRequestMethodNotSupportedException,InfraConfigurationException,InternalServerException,MethodArgumentNotValidException,MethodNotAllowedException,MethodParameterResolvingException,MissingMatrixVariableException,MissingPathVariableException,MissingRequestCookieException,MissingRequestHeaderException,MissingRequestParameterException,MissingRequestPartException,MissingRequestValueException,NotAcceptableStatusException,ParameterConversionException,ParameterResolverNotFoundException,RequestBindingException,ResponseStatusException,ReturnValueHandlerNotFoundException,UnsatisfiedRequestParameterException,UnsupportedMediaTypeStatusException,ViewRenderingException
Representation of a complete RFC 7807 error response including status,
headers, and an RFC 7807 formatted
ProblemDetail body. Allows any
exception to expose HTTP error response information.
ErrorResponseException is a default implementation of this
interface and a convenient base class for other exceptions to use.
An @ExceptionHandler method can use ResponseEntity.of(ProblemDetail)
to map an ErrorResponse to a ResponseEntity.
ErrorResponse is supported as a return value from
@ExceptionHandler methods that render directly to the response, e.g.
by being marked @ResponseBody, or declared in an
@RestController or RestControllerAdvice class.
- 从以下版本开始:
- 4.0 2022/3/2 13:34
- 作者:
- Rossen Stoyanchev, Harry Yang
- 另请参阅:
-
方法概要
修饰符和类型方法说明getBody()Return the body for the response, formatted as an RFC 7807ProblemDetailwhosestatusshould match the response status.default HttpHeadersReturn headers to use for the response.Return the HTTP status code to use for the response.
-
方法详细资料
-
getStatusCode
HttpStatusCode getStatusCode()Return the HTTP status code to use for the response.- 指定者:
getStatusCode在接口中HttpStatusCodeProvider
-
getHeaders
Return headers to use for the response. -
getBody
ProblemDetail getBody()Return the body for the response, formatted as an RFC 7807ProblemDetailwhosestatusshould match the response status.
-