mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-31 14:17:03 +02:00
Save unexpected errors
This commit is contained in:
@@ -23,6 +23,7 @@ import android.app.Application;
|
||||
import android.app.Notification;
|
||||
import android.app.NotificationChannel;
|
||||
import android.app.NotificationManager;
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.os.DeadSystemException;
|
||||
import android.os.RemoteException;
|
||||
@@ -46,7 +47,7 @@ public class ApplicationEx extends Application {
|
||||
public void uncaughtException(Thread thread, Throwable ex) {
|
||||
if (ownFault(ex)) {
|
||||
Log.e(Helper.TAG, ex + "\r\n" + Log.getStackTraceString(ex));
|
||||
writeCrashLog(ex);
|
||||
writeCrashLog(ApplicationEx.this, ex);
|
||||
|
||||
if (prev != null)
|
||||
prev.uncaughtException(thread, ex);
|
||||
@@ -112,8 +113,8 @@ public class ApplicationEx extends Application {
|
||||
return false;
|
||||
}
|
||||
|
||||
private void writeCrashLog(Throwable ex) {
|
||||
File file = new File(getCacheDir(), "crash.log");
|
||||
static void writeCrashLog(Context context, Throwable ex) {
|
||||
File file = new File(context.getCacheDir(), "crash.log");
|
||||
Log.w(Helper.TAG, "Writing exception to " + file);
|
||||
|
||||
FileWriter out = null;
|
||||
|
||||
Reference in New Issue
Block a user