Class ResponseStatusException

All Implemented Interfaces:
Serializable, ErrorResponse
Direct Known Subclasses:
HandlerMethodValidationException, MethodNotAllowedException, NotAcceptableStatusException, ServerErrorException, ServerWebInputException, UnsupportedMediaTypeStatusException

public class ResponseStatusException extends ErrorResponseException
Subclass of ErrorResponseException that accepts a "reason", and by default maps that to the "detail" of the ProblemDetail.
Since:
5.0
Author:
Rossen Stoyanchev, Juergen Hoeller
See Also:
  • Constructor Details

    • ResponseStatusException

      public ResponseStatusException(HttpStatusCode status)
      Constructor with a response status.
      Parameters:
      status - the HTTP status (required)
    • ResponseStatusException

      public ResponseStatusException(HttpStatusCode status, @Nullable String reason)
      Constructor with a response status and a reason to add to the exception message as explanation.
      Parameters:
      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.
      Parameters:
      rawStatusCode - the HTTP status code value
      reason - the associated reason (optional)
      cause - a nested exception (optional)
      Since:
      5.3
    • 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.
      Parameters:
      status - the HTTP status (required)
      reason - the associated reason (optional)
      cause - a nested exception (optional)
    • ResponseStatusException

      protected ResponseStatusException(HttpStatusCode status, @Nullable String reason, @Nullable Throwable cause, @Nullable String messageDetailCode, @Nullable Object[] messageDetailArguments)
      Constructor with a message code and arguments for resolving the error "detail" via MessageSource.
      Parameters:
      status - the HTTP status (required)
      reason - the associated reason (optional)
      cause - a nested exception (optional)
      Since:
      6.0
  • Method Details