Package javax.ws.rs
Class ServerErrorException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- javax.ws.rs.WebApplicationException
-
- javax.ws.rs.ServerErrorException
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
InternalServerErrorException,ServiceUnavailableException
public class ServerErrorException extends WebApplicationException
A base runtime application exception indicating a server error (HTTP5xxstatus codes).- Since:
- 2.0
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description ServerErrorException(int status)Construct a new server error exception.ServerErrorException(int status, java.lang.Throwable cause)Construct a new server error exception.ServerErrorException(java.lang.String message, int status)Construct a new server error exception.ServerErrorException(java.lang.String message, int status, java.lang.Throwable cause)Construct a new server error exception.ServerErrorException(java.lang.String message, Response response)Construct a new server error exception.ServerErrorException(java.lang.String message, Response.Status status)Construct a new server error exception.ServerErrorException(java.lang.String message, Response.Status status, java.lang.Throwable cause)Construct a new server error exception.ServerErrorException(java.lang.String message, Response response, java.lang.Throwable cause)Construct a new server error exception.ServerErrorException(Response response)Construct a new server error exception.ServerErrorException(Response.Status status)Construct a new server error exception.ServerErrorException(Response.Status status, java.lang.Throwable cause)Construct a new server error exception.ServerErrorException(Response response, java.lang.Throwable cause)Construct a new server error exception.
-
Method Summary
-
Methods inherited from class javax.ws.rs.WebApplicationException
getResponse, validate, validate
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ServerErrorException
public ServerErrorException(Response.Status status)
Construct a new server error exception.- Parameters:
status- server error status. Must be a5xxstatus code.- Throws:
java.lang.IllegalArgumentException- in case the status code isnullor is not fromResponse.Status.Family.SERVER_ERRORstatus code family.
-
ServerErrorException
public ServerErrorException(java.lang.String message, Response.Status status)Construct a new server error exception.- Parameters:
message- the detail message (which is saved for later retrieval by theThrowable.getMessage()method).status- server error status. Must be a5xxstatus code.- Throws:
java.lang.IllegalArgumentException- in case the status code isnullor is not fromResponse.Status.Family.SERVER_ERRORstatus code family.
-
ServerErrorException
public ServerErrorException(int status)
Construct a new server error exception.- Parameters:
status- server error status. Must be a5xxstatus code.- Throws:
java.lang.IllegalArgumentException- in case the status code is not a valid HTTP status code or if it is not from theResponse.Status.Family.SERVER_ERRORstatus code family.
-
ServerErrorException
public ServerErrorException(java.lang.String message, int status)Construct a new server error exception.- Parameters:
message- the detail message (which is saved for later retrieval by theThrowable.getMessage()method).status- server error status. Must be a5xxstatus code.- Throws:
java.lang.IllegalArgumentException- in case the status code is not a valid HTTP status code or if it is not from theResponse.Status.Family.SERVER_ERRORstatus code family.
-
ServerErrorException
public ServerErrorException(Response response)
Construct a new server error exception.- Parameters:
response- server error response. Must have a status code set to a5xxstatus code.- Throws:
java.lang.IllegalArgumentException- in case the response status code is not from theResponse.Status.Family.SERVER_ERRORstatus code family.
-
ServerErrorException
public ServerErrorException(java.lang.String message, Response response)Construct a new server error exception.- Parameters:
message- the detail message (which is saved for later retrieval by theThrowable.getMessage()method).response- server error response. Must have a status code set to a5xxstatus code.- Throws:
java.lang.IllegalArgumentException- in case the response status code is not from theResponse.Status.Family.SERVER_ERRORstatus code family.
-
ServerErrorException
public ServerErrorException(Response.Status status, java.lang.Throwable cause)
Construct a new server error exception.- Parameters:
status- server error status. Must be a5xxstatus code.cause- the underlying cause of the exception.- Throws:
java.lang.IllegalArgumentException- in case the status code isnullor is not fromResponse.Status.Family.SERVER_ERRORstatus code family.
-
ServerErrorException
public ServerErrorException(java.lang.String message, Response.Status status, java.lang.Throwable cause)Construct a new server error exception.- Parameters:
message- the detail message (which is saved for later retrieval by theThrowable.getMessage()method).status- server error status. Must be a5xxstatus code.cause- the underlying cause of the exception.- Throws:
java.lang.IllegalArgumentException- in case the status code isnullor is not fromResponse.Status.Family.SERVER_ERRORstatus code family.
-
ServerErrorException
public ServerErrorException(int status, java.lang.Throwable cause)Construct a new server error exception.- Parameters:
status- server error status. Must be a5xxstatus code.cause- the underlying cause of the exception.- Throws:
java.lang.IllegalArgumentException- in case the status code is not a valid HTTP status code or if it is not from theResponse.Status.Family.SERVER_ERRORstatus code family.
-
ServerErrorException
public ServerErrorException(java.lang.String message, int status, java.lang.Throwable cause)Construct a new server error exception.- Parameters:
message- the detail message (which is saved for later retrieval by theThrowable.getMessage()method).status- server error status. Must be a5xxstatus code.cause- the underlying cause of the exception.- Throws:
java.lang.IllegalArgumentException- in case the status code is not a valid HTTP status code or if it is not from theResponse.Status.Family.SERVER_ERRORstatus code family.
-
ServerErrorException
public ServerErrorException(Response response, java.lang.Throwable cause)
Construct a new server error exception.- Parameters:
response- server error response. Must have a status code set to a5xxstatus code.cause- the underlying cause of the exception.- Throws:
java.lang.IllegalArgumentException- in case the response status code is not from theResponse.Status.Family.SERVER_ERRORstatus code family.
-
ServerErrorException
public ServerErrorException(java.lang.String message, Response response, java.lang.Throwable cause)Construct a new server error exception.- Parameters:
message- the detail message (which is saved for later retrieval by theThrowable.getMessage()method).response- server error response. Must have a status code set to a5xxstatus code.cause- the underlying cause of the exception.- Throws:
java.lang.IllegalArgumentException- in case the response status code is not from theResponse.Status.Family.SERVER_ERRORstatus code family.
-
-