public class SdkServiceException extends SdkException
Exceptions that extend SdkServiceException
are assumed to be able to be
successfully retried.
SdkServiceException provides callers several pieces of information that can be used to obtain more information about the error and why it occurred.
SdkClientException
,
Serialized FormConstructor and Description |
---|
SdkServiceException(String errorMessage)
Constructs a new SdkServiceException with the specified message.
|
SdkServiceException(String errorMessage,
Exception cause)
Constructs a new SdkServiceException with the specified message and
exception indicating the root cause.
|
Modifier and Type | Method and Description |
---|---|
String |
errorCode()
Returns the error code associated with the response.
|
void |
errorCode(String errorCode) |
String |
errorMessage() |
void |
errorMessage(String errorMessage) |
ErrorType |
errorType()
Returns the
ErrorType associated with the request. |
void |
errorType(ErrorType errorType) |
String |
getMessage() |
Map<String,String> |
headers()
Returns a map of HTTP headers associated with the error response.
|
void |
headers(Map<String,String> headers) |
byte[] |
rawResponse()
Returns the response payload as bytes.
|
void |
rawResponse(byte[] rawResponse) |
String |
requestId()
Returns the request ID that uniquely identifies the service request
the caller made.
|
void |
requestId(String requestId) |
String |
serviceName()
Returns the name of the service that sent this error response.
|
void |
serviceName(String serviceName) |
int |
statusCode()
Returns the HTTP status code that was returned with this service
exception.
|
void |
statusCode(int statusCode) |
retryable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public SdkServiceException(String errorMessage)
errorMessage
- An error message describing what went wrong.public SdkServiceException(String errorMessage, Exception cause)
errorMessage
- An error message describing what went wrong.cause
- The root exception that caused this exception to be thrown.public String requestId()
public void requestId(String requestId)
public String serviceName()
public void serviceName(String serviceName)
public String errorMessage()
public void errorMessage(String errorMessage)
public String errorCode()
public void errorCode(String errorCode)
public void errorType(ErrorType errorType)
public int statusCode()
public void statusCode(int statusCode)
public byte[] rawResponse()
public void rawResponse(byte[] rawResponse)
public Map<String,String> headers()
public String getMessage()
getMessage
in class Throwable
Copyright © 2017 Amazon Web Services, Inc. All Rights Reserved.