Commit ac8bf2e0 authored by Daniel Wolf's avatar Daniel Wolf

Show the error dialog for every exception whilst some problems of this version remain unfixed.

parent 42548a13
......@@ -21,16 +21,18 @@ public class DNSChanger extends Application {
public void uncaughtException(Thread t, Throwable e) {
LogFactory.writeMessage(DNSChanger.this, new String[]{LOG_TAG, LogFactory.Tag.ERROR.toString()}, "Caught uncaught exception");
LogFactory.writeStackTrace(DNSChanger.this, new String[]{LOG_TAG, LogFactory.Tag.ERROR.toString()}, e);
if (defaultHandler != null) defaultHandler.uncaughtException(t, e);
if (showErrorDialog(e)) {
ErrorDialogActivity.show(DNSChanger.this, e);
System.exit(2);
} else if (defaultHandler != null) defaultHandler.uncaughtException(t, e);
}
}
};
private Thread.UncaughtExceptionHandler defaultHandler;
private boolean showErrorDialog(Throwable exception) {
return exception.getMessage() != null && exception.getMessage().toLowerCase().contains("cannot create interface");
return true;
//return exception.getMessage() != null && exception.getMessage().toLowerCase().contains("cannot create interface");
}
@Override
......
Markdown is supported
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