Package com.github.ambry.rest
Class RestServiceException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- com.github.ambry.rest.RestServiceException
-
- All Implemented Interfaces:
java.io.Serializable
public class RestServiceException extends java.lang.Exception
Exceptions thrown by different layers of the RESTful frontend. All exceptions are accompanied by aRestServiceErrorCode
.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description RestServiceException(java.lang.String message, RestServiceErrorCode error)
RestServiceException(java.lang.String message, RestServiceErrorCode error, boolean includeExceptionMessageInResponse)
RestServiceException(java.lang.String message, java.lang.Throwable e, RestServiceErrorCode error)
RestServiceException(java.lang.Throwable e, RestServiceErrorCode error)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RestServiceErrorCode
getErrorCode()
boolean
shouldIncludeExceptionMessageInResponse()
-
-
-
Constructor Detail
-
RestServiceException
public RestServiceException(java.lang.String message, RestServiceErrorCode error)
- Parameters:
message
- the exception message.error
- theRestServiceErrorCode
.
-
RestServiceException
public RestServiceException(java.lang.String message, java.lang.Throwable e, RestServiceErrorCode error)
- Parameters:
message
- the exception message.e
- the exception cause.error
- theRestServiceErrorCode
.
-
RestServiceException
public RestServiceException(java.lang.Throwable e, RestServiceErrorCode error)
- Parameters:
e
- the exception cause.error
- theRestServiceErrorCode
.
-
RestServiceException
public RestServiceException(java.lang.String message, RestServiceErrorCode error, boolean includeExceptionMessageInResponse)
- Parameters:
message
- the exception message.error
- theRestServiceErrorCode
.includeExceptionMessageInResponse
-true
to hint that the exception message should be returned to the client as a response header.
-
-
Method Detail
-
getErrorCode
public RestServiceErrorCode getErrorCode()
-
shouldIncludeExceptionMessageInResponse
public boolean shouldIncludeExceptionMessageInResponse()
-
-