Skip to content

Commit 80859ed

Browse files
author
Bartosz Litwiniuk
committed
Remove checking throwable type
1 parent 6bc480d commit 80859ed

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

backtrace-library/src/main/java/backtraceio/library/models/BacktraceExceptionHandler.java

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,23 +53,18 @@ public static void enable(BacktraceClient client) {
5353
public void uncaughtException(final Thread thread, final Throwable throwable) {
5454
OnServerResponseEventListener callback = getCallbackToDefaultHandler(thread, throwable);
5555

56-
if (throwable instanceof Exception) {
57-
BacktraceLogger.e(LOG_TAG, "Sending uncaught exception to Backtrace API", throwable);
58-
BacktraceReport report = new BacktraceReport((Exception) throwable, BacktraceExceptionHandler.customAttributes);
59-
report.attributes.put(BacktraceAttributeConsts.ErrorType, BacktraceAttributeConsts.UnhandledExceptionAttributeType);
60-
this.client.send(report, callback);
61-
BacktraceLogger.d(LOG_TAG, "Uncaught exception sent to Backtrace API");
62-
}
63-
BacktraceLogger.d(LOG_TAG, "Default uncaught exception handler");
56+
BacktraceLogger.e(LOG_TAG, "Sending uncaught exception to Backtrace API", throwable);
57+
BacktraceReport report = new BacktraceReport((Exception) throwable, BacktraceExceptionHandler.customAttributes);
58+
report.attributes.put(BacktraceAttributeConsts.ErrorType, BacktraceAttributeConsts.UnhandledExceptionAttributeType);
59+
this.client.send(report, callback);
60+
BacktraceLogger.d(LOG_TAG, "Uncaught exception sent to Backtrace API");
61+
6462
try {
6563
signal.await();
6664
} catch (Exception ex) {
6765
BacktraceLogger.e(LOG_TAG, "Exception during waiting for response", ex);
6866
}
69-
}
70-
71-
private boolean isMainThread() {
72-
return Looper.myLooper() == Looper.getMainLooper();
67+
BacktraceLogger.d(LOG_TAG, "Default uncaught exception handler");
7368
}
7469

7570
private OnServerResponseEventListener getCallbackToDefaultHandler(final Thread thread, final Throwable throwable) {

0 commit comments

Comments
 (0)