Skip to content

Commit ec2e763

Browse files
authored
Merge pull request #112 from tencentyun/add_the_exp_msg
打印异常类型
2 parents 936a7e3 + 8aeab5e commit ec2e763

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/com/qcloud/cos/http/DefaultCosHttpClient.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,8 +497,9 @@ public <X, Y extends CosServiceRequest> X exeute(CosHttpRequest<Y> request,
497497
throw cce;
498498
}
499499
} catch (Exception exp) {
500-
String errorMsg = String.format("httpClient execute occur a unknow exception, httpRequest: %s",
501-
request.toString());
500+
String expName = exp.getClass().getName();
501+
String errorMsg = String.format("httpClient execute occur an unknown exception:%s, httpRequest: %s"
502+
, expName, request);
502503
closeHttpResponseStream(httpResponse);
503504
log.error(errorMsg, exp);
504505
throw new CosClientException(errorMsg, exp);

0 commit comments

Comments
 (0)