Skip to content

Commit 87516c8

Browse files
authored
Move log of error to proper place. (#407)
1 parent 53f11d5 commit 87516c8

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,6 @@ public Request(String httpMethod, String apiAction, Map<String, Object> params)
5353
this.httpMethod = httpMethod;
5454
this.apiAction = apiAction;
5555
this.params = params != null ? params : new HashMap<>();
56-
// Check if it is error and here was SQLite exception.
57-
if (RequestBuilder.ACTION_LOG.equals(apiAction) && LeanplumEventDataManager.sharedInstance().willSendErrorLogs()) {
58-
RequestSender.getInstance().addLocalError(this);
59-
}
6056
}
6157

6258
public void onResponse(ResponseCallback response) {

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,13 @@ public void sendEventually(Request request) {
164164

165165
if (!request.isSent()) {
166166
request.setSent(true);
167+
168+
// Check if it's error and there was SQLite exception.
169+
if (RequestBuilder.ACTION_LOG.equals(request.getApiAction())
170+
&& LeanplumEventDataManager.sharedInstance().willSendErrorLogs()) {
171+
addLocalError(request);
172+
}
173+
167174
Map<String, Object> args = createArgsDictionary(request);
168175
saveRequestForLater(request, args);
169176
}
@@ -477,7 +484,7 @@ private void sendIfDelayedHelper(Request request) {
477484
}
478485
}
479486

480-
public void addLocalError(Request request) {
487+
private void addLocalError(Request request) {
481488
Map<String, Object> dict = createArgsDictionary(request);
482489
localErrors.add(dict);
483490
}

0 commit comments

Comments
 (0)