org.springframework.web.server

Class ServerErrorException

  • All Implemented Interfaces:
    java.io.Serializable


    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:
    Serialized Form
    • Constructor Detail

      • ServerErrorException

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

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

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

        @Deprecated
        public ServerErrorException(java.lang.String reason)
        Constructor for a 500 error with a reason only.
    • Method Detail

      • getHandlerMethod

        @Nullable
        public java.lang.reflect.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.