Package org.springframework.web.server
Class ServerErrorException
- java.lang.Object
- java.lang.Throwable
- java.lang.Exception
- java.lang.RuntimeException
- org.springframework.core.NestedRuntimeException
- org.springframework.web.server.ResponseStatusException
- org.springframework.web.server.ServerErrorException
- All Implemented Interfaces:
Serializable
public class ServerErrorException extends ResponseStatusException
Exception for anHttpStatus.INTERNAL_SERVER_ERRORthat 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 Summary
Constructors Constructor Description ServerErrorException(String reason)Deprecated.in favor ofServerErrorException(String, Throwable)ServerErrorException(String reason, Method handlerMethod, Throwable cause)Constructor for a 500 error with a handlerMethodand an optional cause.ServerErrorException(String reason, Throwable cause)Constructor for a 500 error with a reason and an optional cause.ServerErrorException(String reason, MethodParameter parameter)Deprecated.ServerErrorException(String reason, MethodParameter parameter, Throwable cause)Constructor for a 500 error with aMethodParameterand an optional cause.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MethodgetHandlerMethod()Return the handler method associated with the error, if any.MethodParametergetMethodParameter()Return the specific method parameter associated with the error, if any.Methods inherited from class org.springframework.web.server.ResponseStatusException
getHeaders, getMessage, getReason, getResponseHeaders, getStatus
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Constructor Detail
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 handlerMethodand an optional cause.- Since:
- 5.0.5
ServerErrorException
public ServerErrorException(String reason, MethodParameter parameter, @Nullable Throwable cause)
Constructor for a 500 error with aMethodParameterand an optional cause.
ServerErrorException
@Deprecated public ServerErrorException(String reason, MethodParameter parameter)
Deprecated.Constructor for a 500 error linked to a specificMethodParameter.
ServerErrorException
@Deprecated public ServerErrorException(String reason)
Deprecated.in favor ofServerErrorException(String, Throwable)Constructor for a 500 error with a reason only.
Method Detail
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.