Skip to content

Commit 45986f3

Browse files
committed
Update SendUtil.java
1 parent 5e8686f commit 45986f3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

SendSafelyAPI/src/com/sendsafely/utils/SendUtil.java

+8
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
import java.io.IOException;
44
import java.io.InputStream;
5+
import java.io.PrintWriter;
6+
import java.io.StringWriter;
57
import java.util.HashMap;
68

79
import com.google.gson.Gson;
@@ -68,6 +70,12 @@ protected <T> T handleResponse(T clazz) throws IOException, SendFailedException
6870
hashMap.put("responseCode", Integer.toString(responseCode));
6971
hashMap.put("responseMessage", connection.getResponseMessage());
7072
hashMap.put("responseBody", response);
73+
hashMap.put("exceptionClass", e.getClass().toString());
74+
hashMap.put("exceptionMessage", e.getMessage());
75+
StringWriter sw = new StringWriter();
76+
PrintWriter pw = new PrintWriter(sw);
77+
e.printStackTrace(pw);
78+
hashMap.put("exceptionTrace", sw.toString());
7179
Gson gson = new GsonBuilder().serializeNulls().create();
7280
String jsonString = gson.toJson(hashMap);
7381
throw new SendFailedException(jsonString);

0 commit comments

Comments
 (0)