例外變更 - AWS SDK for Java 2.x

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

例外變更

異常類名,它們的結構和它們的關係已經改變。 software.amazon.awssdk.core.exception.SdkException是所有其他異常擴展的新基Exception類。

此表是例外類別名稱變更的對應。

1.x 2.x

com.amazonaws.SdkBaseException com.amazonaws.AmazonClientException

software.amazon.awssdk.core.exception.SdkException

com.amazonaws.SdkClientException

software.amazon.awssdk.core.exception.SdkClientException

com.amazonaws.AmazonServiceException

software.amazon.awssdk.awscore.exception.AwsServiceException

下表映射了 1.x 版和 2.x 之間異常類的方法。

1.x 2.x

AmazonServiceException.getRequestId

SdkServiceException.requestId

AmazonServiceException.getServiceName

AwsServiceException.awsErrorDetails().serviceName

AmazonServiceException.getErrorCode

AwsServiceException.awsErrorDetails().errorCode

AmazonServiceException.getErrorMessage

AwsServiceException.awsErrorDetails().errorMessage

AmazonServiceException.getStatusCode

AwsServiceException.awsErrorDetails().sdkHttpResponse().statusCode

AmazonServiceException.getHttpHeaders

AwsServiceException.awsErrorDetails().sdkHttpResponse().headers

AmazonServiceException.rawResponse

AwsServiceException.awsErrorDetails().rawResponse