类 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
- 所有已实现的接口:
Serializable
public class ServerErrorException extends ResponseStatusException
Exception for anHttpStatus.INTERNAL_SERVER_ERROR
that exposes extra information about a controller method that failed, or a controller method argument that could not be resolved.- 从以下版本开始:
- 5.0
- 作者:
- Rossen Stoyanchev
- 另请参阅:
- 序列化表格
构造器概要
构造器 构造器 说明 ServerErrorException(String reason)
已过时。in favor ofServerErrorException(String, Throwable)
ServerErrorException(String reason, Method handlerMethod, Throwable cause)
Constructor for a 500 error with a handlerMethod
and 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)
已过时。ServerErrorException(String reason, MethodParameter parameter, Throwable cause)
Constructor for a 500 error with aMethodParameter
and an optional cause.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 Method
getHandlerMethod()
Return the handler method associated with the error, if any.MethodParameter
getMethodParameter()
Return the specific method parameter associated with the error, if any.从类继承的方法 org.springframework.web.server.ResponseStatusException
getHeaders, getMessage, getReason, getResponseHeaders, getStatus
从类继承的方法 org.springframework.core.NestedRuntimeException
contains, getMostSpecificCause, getRootCause
构造器详细资料
ServerErrorException
public ServerErrorException(String reason, @Nullable Throwable cause)
Constructor for a 500 error with a reason and an optional cause.- 从以下版本开始:
- 5.0.5
ServerErrorException
public ServerErrorException(String reason, Method handlerMethod, @Nullable Throwable cause)
Constructor for a 500 error with a handlerMethod
and an optional cause.- 从以下版本开始:
- 5.0.5
ServerErrorException
public ServerErrorException(String reason, MethodParameter parameter, @Nullable Throwable cause)
Constructor for a 500 error with aMethodParameter
and an optional cause.
ServerErrorException
@Deprecated public ServerErrorException(String reason, MethodParameter parameter)
已过时。Constructor for a 500 error linked to a specificMethodParameter
.
ServerErrorException
@Deprecated public ServerErrorException(String reason)
已过时。in favor ofServerErrorException(String, Throwable)
Constructor for a 500 error with a reason only.
方法详细资料
getHandlerMethod
@Nullable public Method getHandlerMethod()
Return the handler method associated with the error, if any.- 从以下版本开始:
- 5.0.5
getMethodParameter
@Nullable public MethodParameter getMethodParameter()
Return the specific method parameter associated with the error, if any.