public class ClientException extends RuntimeException
This exception is the one thrown by the client side when accessing OSS.
ClientException
is the class to represent any exception in OSS client
side. Generally ClientException occurs either before sending the request or
after receving the response from OSS server side. For example, if the network
is broken when it tries to send a request, then the SDK will throw a
ClientException
instance.
ServiceException
is converted from error code from OSS response. For
example, when OSS tries to authenticate a request, if Access ID does not
exist, the SDK will throw a ServiceException
or its subclass instance
with the specific error code, which the caller could handle that with
specific logic.
构造器和说明 |
---|
ClientException()
Creates a default instance.
|
ClientException(String errorMessage)
Creates an instance with error message.
|
ClientException(String errorMessage,
String errorCode,
String requestId)
Creates an instance with error message, error code, request Id
|
ClientException(String errorMessage,
String errorCode,
String requestId,
Throwable cause)
Creates an instance with error message, error code, request Id and an
exception.
|
ClientException(String errorMessage,
Throwable cause)
Creates an instance with error message and an exception.
|
ClientException(Throwable cause)
Creates an instance with an exception
|
限定符和类型 | 方法和说明 |
---|---|
String |
getErrorCode()
Get error code.
|
String |
getErrorMessage()
Get error message.
|
String |
getMessage() |
String |
getRequestId()
Gets request id.
|
public ClientException()
public ClientException(String errorMessage)
errorMessage
- Error message.public ClientException(Throwable cause)
cause
- An exception.public ClientException(String errorMessage, Throwable cause)
errorMessage
- Error message.cause
- An exception.public ClientException(String errorMessage, String errorCode, String requestId)
errorMessage
- Error message.errorCode
- Error code, which typically is from a set of predefined
errors. The handler code could do action based on this.requestId
- Request Id.public String getErrorMessage()
public String getErrorCode()
public String getRequestId()
public String getMessage()
getMessage
在类中 Throwable
Copyright © 2019. All Rights Reserved.