Skip to content

Commit 6c92ec8

Browse files
authored
Sending crash as log (#412)
1 parent ee1b00f commit 6c92ec8

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

AndroidSDKCore/src/main/java/com/leanplum/internal/Constants.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,6 @@ public static class Values {
231231
public static final String CHAIN_MESSAGE_ACTION_NAME = "Chain to Existing Message";
232232
public static final String DEFAULT_PUSH_MESSAGE = "Push message goes here.";
233233
public static final String SDK_LOG = "sdkLog";
234-
public static final String SDK_ERROR = "sdkError";
235234
public static final String SDK_COUNT = "sdkCount";
236235
public static final String FILE_PREFIX = "__file__";
237236
}

AndroidSDKCore/src/main/java/com/leanplum/internal/Log.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,14 @@ public static void exception(Throwable throwable) {
9696

9797
StringWriter stringWriter = new StringWriter();
9898
PrintWriter writer = new PrintWriter(stringWriter);
99+
writer.println(message);
100+
99101
throwable.printStackTrace(writer);
100102

101103
Request request = RequestBuilder.withLogAction()
102-
.andParam(Constants.Params.TYPE, Constants.Values.SDK_ERROR)
104+
.andParam(Constants.Params.TYPE, Constants.Values.SDK_LOG)
103105
.andParam(Constants.Params.VERSION_NAME, versionName)
104-
.andParam(Constants.Params.STACK_TRACE, writer.toString())
105-
.andParam(Constants.Params.MESSAGE, message)
106+
.andParam(Constants.Params.MESSAGE, writer.toString())
106107
.create();
107108
RequestSender.getInstance().send(request);
108109
} catch (Throwable t2) {

0 commit comments

Comments
 (0)