Class ResponseStatusException

    • Constructor Detail

      • ResponseStatusException

        public ResponseStatusException​(HttpStatus 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​(HttpStatus 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)
    • Method Detail

      • getHeaders

        @Deprecated
        public Map<String,​StringgetHeaders()
        Deprecated.
        as of 5.1.13 in favor of getResponseHeaders()
        Return headers associated with the exception that should be added to the error response, e.g. "Allow", "Accept", etc.

        The default implementation in this class returns an empty map.

        Since:
        5.1.11
      • getResponseHeaders

        public HttpHeaders getResponseHeaders()
        Return headers associated with the exception that should be added to the error response, e.g. "Allow", "Accept", etc.

        The default implementation in this class returns empty headers.

        Since:
        5.1.13