Class ServerErrorException

All Implemented Interfaces:
Serializable, ErrorResponse

public class ServerErrorException extends ResponseStatusException
Exception for an HttpStatus.INTERNAL_SERVER_ERROR that exposes extra information about a controller method that failed, or a controller method argument that could not be resolved.
Since:
5.0
Author:
Rossen Stoyanchev
See Also:
  • Constructor Details

    • ServerErrorException

      public ServerErrorException(String reason, @Nullable Throwable cause)
      Constructor for a 500 error with a reason and an optional cause.
      Since:
      5.0.5
    • ServerErrorException

      public ServerErrorException(String reason, Method handlerMethod, @Nullable Throwable cause)
      Constructor for a 500 error with a handler Method and an optional cause.
      Since:
      5.0.5
    • ServerErrorException

      public ServerErrorException(String reason, MethodParameter parameter, @Nullable Throwable cause)
      Constructor for a 500 error with a MethodParameter and an optional cause.
  • Method Details

    • getHandlerMethod

      @Nullable public Method getHandlerMethod()
      Return the handler method associated with the error, if any.
      Since:
      5.0.5
    • getMethodParameter

      @Nullable public MethodParameter getMethodParameter()
      Return the specific method parameter associated with the error, if any.