public class OSSException extends Exception
Modifier and Type | Class and Description |
---|---|
static class |
OSSException.ExceptionType |
Constructor and Description |
---|
OSSException(String bucketName,
String objectKey,
Exception e)
发生本地异常时,构造一个OSSException用来包裹它
|
OSSException(String bucketName,
String objectKey,
OSSResponseInfo ossResp)
OSS返回异常信息时,构造一个OSSException用来接受这个信息
|
Modifier and Type | Method and Description |
---|---|
String |
getBucketName() |
Exception |
getException()
Deprecated.
由于命名不清,此接口功能由getLocalException提供
|
OSSException.ExceptionType |
getExceptionType()
返回此次异常的类型。在查看异常信息前,应该调用此方法判断异常类型。
类型分为LOCAL_EXCEPTION和OSS_EXCEPTION
|
Exception |
getLocalException()
如果此次异常类型为LOCAL_EXCEPTION,那么调用此方法得到该本地异常。
|
String |
getMessage() |
String |
getObjectKey() |
OSSResponseInfo |
getOssRespInfo()
如果此次异常类型为OSS_EXCEPTION,那么调用此方法得到OSS回应的信息。
|
StackTraceElement[] |
getStackTrace() |
void |
printStackTrace() |
void |
setBucketName(String bucketName) |
void |
setException(Exception exception) |
void |
setObjectKey(String objectKey) |
void |
setOssRespInfo(OSSResponseInfo ossRespInfo) |
String |
toString()
此次异常的具体信息
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getSuppressed, initCause, printStackTrace, printStackTrace, setStackTrace
public OSSException(String bucketName, String objectKey, Exception e)
objectKey
- e
- public OSSException(String bucketName, String objectKey, OSSResponseInfo ossResp)
objectKey
- ossResp
- public OSSException.ExceptionType getExceptionType()
public String getObjectKey()
public void setObjectKey(String objectKey)
public OSSResponseInfo getOssRespInfo()
public void setOssRespInfo(OSSResponseInfo ossRespInfo)
public void setException(Exception exception)
@Deprecated public Exception getException()
public Exception getLocalException()
public String getMessage()
getMessage
in class Throwable
public void printStackTrace()
printStackTrace
in class Throwable
public StackTraceElement[] getStackTrace()
getStackTrace
in class Throwable
public String getBucketName()
public void setBucketName(String bucketName)
Copyright © 2015. All rights reserved.