From 1d6f93da06474315533accf8f2299dcff8e0022e Mon Sep 17 00:00:00 2001 From: czq <89424516@qq.com> Date: Wed, 21 Apr 2021 19:15:57 +0800 Subject: [PATCH] use for self define error handle, default OSSErrorResponseHandler response data is too sample --- .gitignore | 4 +++- src/main/java/com/aliyun/oss/internal/OSSOperation.java | 8 ++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index a05b0a82..ac12dcba 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ /target/ /.settings/ .classpath -.project \ No newline at end of file +.project +.idea +*.iml \ No newline at end of file diff --git a/src/main/java/com/aliyun/oss/internal/OSSOperation.java b/src/main/java/com/aliyun/oss/internal/OSSOperation.java index 4e060306..76989ab5 100644 --- a/src/main/java/com/aliyun/oss/internal/OSSOperation.java +++ b/src/main/java/com/aliyun/oss/internal/OSSOperation.java @@ -57,6 +57,14 @@ public abstract class OSSOperation { protected static RequestIdResponseParser requestIdResponseParser = new RequestIdResponseParser(); protected static RetryStrategy noRetryStrategy = new NoRetryStrategy(); + /** + * use for self define error handle, default OSSErrorResponseHandler response data is too sample + * @param handler + */ + public static void setDefaultOSSErrorResponseHandler(OSSErrorResponseHandler handler){ + errorResponseHandler = handler; + } + protected OSSOperation(ServiceClient client, CredentialsProvider credsProvider) { this.client = client; this.credsProvider = credsProvider;