File tree Expand file tree Collapse file tree 4 files changed +31
-9
lines changed
src/main/java/com/volcengine Expand file tree Collapse file tree 4 files changed +31
-9
lines changed Original file line number Diff line number Diff line change 11Change log
22
3+ 2025-09-04 Bumped to version v1.0.236
4+ - Updated apis for sms
5+
362025-08-28 Bumped to version v1.0.235
47- Updated apis for businessSecurity/livesaas/vod
58
Original file line number Diff line number Diff line change 44 xsi : schemaLocation =" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" >
55 <modelVersion >4.0.0</modelVersion >
66 <groupId >com.volcengine</groupId >
7- <version >1.0.235 </version >
7+ <version >1.0.236 </version >
88 <artifactId >volc-sdk-java</artifactId >
99
1010 <name >volc-sdk-java</name >
Original file line number Diff line number Diff line change 33import lombok .Data ;
44import org .apache .http .Header ;
55
6+ import java .io .PrintWriter ;
7+ import java .io .StringWriter ;
8+
69@ Data
710public class RawResponse {
811
@@ -44,4 +47,27 @@ public String getFirstHeader(String key) {
4447 }
4548 return null ;
4649 }
50+
51+ public String getVerboseExceptionMessage () {
52+ if (this .getException () == null ) {
53+ return null ;
54+ }
55+ StringBuilder msg = new StringBuilder ();
56+ msg .append (this .getException ().getMessage ()).append (":" );
57+ if (this .getHeaders () != null ) {
58+ for (Header header : this .getHeaders ()) {
59+ if (header != null ) {
60+ msg .append ("Header name is " ).append (header .getName ()).
61+ append (", value is " ).append (header .getValue ()).append (System .lineSeparator ());
62+ }
63+ }
64+ }
65+ msg .append ("http code is " ).append (this .getHttpCode ());
66+
67+ StringWriter sw = new StringWriter ();
68+ PrintWriter pw = new PrintWriter (sw );
69+ this .getException ().printStackTrace (pw );
70+ msg .append (System .lineSeparator ()).append (sw );
71+ return msg .toString ();
72+ }
4773}
Original file line number Diff line number Diff line change @@ -350,14 +350,7 @@ private SmsSendResponse getSmsSendResponse(RawResponse response) throws Exceptio
350350 private SmsSendResponse getSmsSendResponseV2 (RawResponse response ) throws Exception {
351351 if (response .getCode () != SdkError .SUCCESS .getNumber ()) {
352352 if (response .getException () != null ) {
353- for (Header header : response .getHeaders ()) {
354- if (header != null ) {
355- log .info ("Header name is" + header .getName () + ",value is " + header .getValue ());
356- }
357- }
358- log .error ("Http code is " + response .getHttpCode ());
359- log .error ("exception is " , response .getException ());
360- return new SmsSendResponse (String .valueOf (response .getCode ()), response .getException ().getMessage ());
353+ return new SmsSendResponse (String .valueOf (response .getCode ()), response .getVerboseExceptionMessage ());
361354 }
362355 return new SmsSendResponse (String .valueOf (response .getCode ()), Arrays .toString (response .getData ()));
363356 }
You can’t perform that action at this time.
0 commit comments