Class ServerErrorException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- org.symphonyoss.s2.canon.runtime.exception.CanonException
-
- org.symphonyoss.s2.canon.runtime.exception.ServerErrorException
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
NotImplementedException
public class ServerErrorException extends CanonException
An Exception which may be thrown by Canon implementing methods to indicate that something went wrong. This has the same effect as throwing any RuntimeException, but is more elegant where the implementing code needs to wrap some other checked exception.- Author:
- Bruce Skingle
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ServerErrorException()Default constructor.ServerErrorException(int httpStatusCode, String message, org.apache.http.client.methods.CloseableHttpResponse response)Constructor with message and HTTP response.ServerErrorException(int httpStatusCode, org.apache.http.client.methods.CloseableHttpResponse response)Constructor with HTTP response.ServerErrorException(String message)Constructor with message.ServerErrorException(String message, Throwable cause)Constructor with message and cause.ServerErrorException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace)Constructor with message, cause, suppression enabled or disabled, and writable stack trace enabled or disabled.ServerErrorException(Throwable cause)Constructor with cause.
-
Method Summary
-
Methods inherited from class org.symphonyoss.s2.canon.runtime.exception.CanonException
getHttpStatusCode, getResponseBody, getResponseHeaders
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
ServerErrorException
public ServerErrorException()
Default constructor. HTTP status 500 is implied.
-
ServerErrorException
public ServerErrorException(String message)
Constructor with message.- Parameters:
message- A message describing the detail of the fault.
-
ServerErrorException
public ServerErrorException(String message, Throwable cause)
Constructor with message and cause.- Parameters:
message- A message describing the detail of the fault.cause- The underlying cause of the fault.
-
ServerErrorException
public ServerErrorException(Throwable cause)
Constructor with cause.- Parameters:
cause- The underlying cause of the fault.
-
ServerErrorException
public ServerErrorException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace)
Constructor with message, cause, suppression enabled or disabled, and writable stack trace enabled or disabled.- Parameters:
message- A message describing the detail of the fault.cause- The underlying cause of the fault.enableSuppression- whether or not suppression is enabled or disabledwritableStackTrace- whether or not the stack trace should be writable
-
ServerErrorException
public ServerErrorException(int httpStatusCode, String message, org.apache.http.client.methods.CloseableHttpResponse response)Constructor with message and HTTP response. The body of the response is saved and can be retrieved with @see getResponseBody- Parameters:
httpStatusCode- The HTTP status code relating to the cause of this exception.message- A message describing the detail of the fault.response- An HTTP response which is saved as the cause of the exception.
-
ServerErrorException
public ServerErrorException(int httpStatusCode, org.apache.http.client.methods.CloseableHttpResponse response)Constructor with HTTP response. The body of the response is saved and can be retrieved with @see getResponseBody- Parameters:
httpStatusCode- The HTTP status code relating to the cause of this exception.response- An HTTP response which is saved as the cause of the exception.
-
-