public class ServiceException
extends java.lang.Exception
The OSS server side exception class definition.
ClientException
means there're errors occurred when sending request to OSS or parsing the response from OSS.
For example when the network is unavailable, this exception will be thrown.
ServiceException
means there're errors occurred in OSS service side. For example, the Access Id
does not exist for authentication, then ServiceException
or its subclass is thrown.
The ServiceException has the error code for the caller to have some specific handling.
Generally speaking, the caller only needs to handle ServiceException
as it means the request
has reached OSS, but there're some errors occurred. This error in most of cases are expected due to
wrong parameters int the request or some wrong settings in user's account. The error code is very helpful
for troubleshooting.
限定符和类型 | 字段和说明 |
---|---|
static java.lang.String |
PARSE_RESPONSE_FAIL |
构造器和说明 |
---|
ServiceException(int statusCode,
java.lang.String message,
java.lang.String errorCode,
java.lang.String requestId,
java.lang.String hostId,
java.lang.String rawMessage)
The constructor with status code, message, error code , request Id and host Id
|
限定符和类型 | 方法和说明 |
---|---|
java.lang.String |
getErrorCode()
Gets the error code
|
java.lang.String |
getHostId()
Gets the host Id
|
java.lang.String |
getPartEtag() |
java.lang.String |
getPartNumber() |
java.lang.String |
getRawMessage() |
java.lang.String |
getRequestId()
Gets the request Id
|
int |
getStatusCode()
Gets the http status code
|
void |
setPartEtag(java.lang.String partEtag) |
void |
setPartNumber(java.lang.String partNumber) |
java.lang.String |
toString() |
public static final java.lang.String PARSE_RESPONSE_FAIL
public ServiceException(int statusCode, java.lang.String message, java.lang.String errorCode, java.lang.String requestId, java.lang.String hostId, java.lang.String rawMessage)
statusCode
- HTTP status codemessage
- error messageerrorCode
- error coderequestId
- Request IDhostId
- Host IDpublic java.lang.String getPartNumber()
public void setPartNumber(java.lang.String partNumber)
public java.lang.String getPartEtag()
public void setPartEtag(java.lang.String partEtag)
public int getStatusCode()
public java.lang.String getErrorCode()
public java.lang.String getRequestId()
public java.lang.String getHostId()
public java.lang.String toString()
toString
在类中 java.lang.Throwable
public java.lang.String getRawMessage()