public class CosServiceException extends CosClientException
Modifier and Type | Class and Description |
---|---|
static class |
CosServiceException.ErrorType
Indicates who is responsible (if known) for a failed request.
|
Constructor and Description |
---|
CosServiceException(String errorMessage)
Constructs a new CosServiceException with the specified message.
|
CosServiceException(String errorMessage,
Exception cause)
Constructs a new CosServiceException with the specified message and exception indicating the
root cause.
|
CosServiceException(String message,
String errorResponseXml)
Constructs a new
CosServiceException with the specified message and error response xml
from Qcloud COS. |
Modifier and Type | Method and Description |
---|---|
Map<String,String> |
getAdditionalDetails() |
String |
getErrorCode()
Returns the COS error code represented by this exception.
|
String |
getErrorMessage()
return the human-readable error message provided by the service
|
String |
getErrorResponseXml() |
CosServiceException.ErrorType |
getErrorType()
Indicates who is responsible for this exception (caller, service, or unknown).
|
String |
getMessage() |
String |
getRawResponseContent()
Typically only useful for debugging purpose if for some reason the SDK cannot parse the HTTP
response from a service
|
String |
getRequestId()
Returns the COS request ID that uniquely identifies the service request the caller made.
|
int |
getStatusCode()
Returns the HTTP status code that was returned with this service exception.
|
String |
getTraceId() |
void |
setAdditionalDetails(Map<String,String> additionalDetails) |
void |
setErrorCode(String errorCode)
Sets the COS error code represented by this exception.
|
void |
setErrorMessage(String value)
Sets the human-readable error message provided by the service.
|
void |
setErrorType(CosServiceException.ErrorType errorType)
Sets the type of error represented by this exception (sender, receiver, or unknown),
indicating if this exception was the caller's fault, or the service's fault.
|
void |
setRawResponseContent(String rawResponseContent)
Typically only useful for debugging purpose if for some reason the SDK cannot parse the HTTP
* response from a service
|
void |
setRequestId(String requestId)
Sets the COS requestId for this exception.
|
void |
setStatusCode(int statusCode)
Sets the HTTP status code that was returned with this service exception.
|
void |
setTraceId(String tranceId) |
String |
toString() |
isRequestTimeout, isRetryable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
public CosServiceException(String errorMessage)
errorMessage
- An error message describing what went wrong.public CosServiceException(String errorMessage, Exception cause)
errorMessage
- An error message describing what went wrong.cause
- The root exception that caused this exception to be thrown.public CosServiceException(String message, String errorResponseXml)
CosServiceException
with the specified message and error response xml
from Qcloud COS.message
- The error message describing why this exception was thrown.errorResponseXml
- The original error response XML received from Qcloud COSCosServiceException(String)
public void setRequestId(String requestId)
requestId
- The unique identifier for the service request the caller made.public String getRequestId()
public void setErrorCode(String errorCode)
setErrorCode
in class CosClientException
errorCode
- The COS error code represented by this exception.public String getErrorCode()
getErrorCode
in class CosClientException
public void setErrorType(CosServiceException.ErrorType errorType)
errorType
- The type of error represented by this exception (sender or receiver),
indicating if this exception was the caller's fault or the service's fault.public CosServiceException.ErrorType getErrorType()
public String getErrorMessage()
public void setErrorMessage(String value)
public void setStatusCode(int statusCode)
statusCode
- The HTTP status code that was returned with this service exception.public int getStatusCode()
public String getTraceId()
public void setTraceId(String tranceId)
public String getErrorResponseXml()
public String getMessage()
getMessage
in class Throwable
public String getRawResponseContent()
public void setRawResponseContent(String rawResponseContent)
rawResponseContent
- The raw content of the HTTP responsepublic String toString()
toString
in class CosClientException
Copyright © 2024. All rights reserved.