Commit 2b489ec2 authored by Roger Yang's avatar Roger Yang
Browse files

Closes #7722: Record uncaught exception in Android log

parent 862331cc
......@@ -4,11 +4,14 @@
package mozilla.components.lib.crash.handler
import android.annotation.SuppressLint
import android.content.Context
import android.os.Process
import android.util.Log
import mozilla.components.lib.crash.Crash
import mozilla.components.lib.crash.CrashReporter
private const val TAG = "ExceptionHandler"
* [Thread.UncaughtExceptionHandler] implementation that forwards crashes to the [CrashReporter] instance.
......@@ -18,7 +21,10 @@ class ExceptionHandler(
) : Thread.UncaughtExceptionHandler {
private var crashing = false
@SuppressLint("LogUsage") // We do not want to use our custom logger while handling the crash
override fun uncaughtException(thread: Thread, throwable: Throwable) {
Log.e(TAG, "Uncaught exception handled: ", throwable)
if (crashing) {
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment