Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/main/java/com/qcloud/cos/ClientConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import com.qcloud.cos.endpoint.RegionEndpointBuilder;
import com.qcloud.cos.endpoint.SuffixEndpointBuilder;
import com.qcloud.cos.http.HttpProtocol;
import com.qcloud.cos.internal.CosErrorResponseHandler;
import com.qcloud.cos.region.Region;
import com.qcloud.cos.retry.BackoffStrategy;
import com.qcloud.cos.retry.PredefinedBackoffStrategies;
Expand Down Expand Up @@ -86,6 +87,7 @@ public class ClientConfig {
private String userAgent = DEFAULT_USER_AGENT;
private int readLimit = DEFAULT_READ_LIMIT;
private COSSigner cosSigner = new COSSigner();
private CosErrorResponseHandler cosErrorResponseHandler = new CosErrorResponseHandler();

// 不传入region 用于后续调用List Buckets(获取所有的bucket信息)
public ClientConfig() {
Expand Down Expand Up @@ -271,4 +273,12 @@ public COSSigner getCosSigner() {
public void setCosSigner(COSSigner cosSigner) {
this.cosSigner = cosSigner;
}

public CosErrorResponseHandler getCosErrorResponseHandler() {
return cosErrorResponseHandler;
}

public void setCosErrorResponseHandler(CosErrorResponseHandler cosErrorResponseHandler) {
this.cosErrorResponseHandler = cosErrorResponseHandler;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public class DefaultCosHttpClient implements CosHttpClient {

public DefaultCosHttpClient(ClientConfig clientConfig) {
super();
this.errorResponseHandler = new CosErrorResponseHandler();
this.errorResponseHandler = clientConfig.getCosErrorResponseHandler();
this.clientConfig = clientConfig;
this.connectionManager = new PoolingHttpClientConnectionManager();
this.maxErrorRetry = clientConfig.getMaxErrorRetry();
Expand Down