Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Wade
DnsChanger
Commits
ac8bf2e0
Commit
ac8bf2e0
authored
Apr 14, 2018
by
Daniel Wolf
Browse files
Show the error dialog for every exception whilst some problems of this version remain unfixed.
parent
42548a13
Changes
1
Show whitespace changes
Inline
Side-by-side
app/src/main/java/com/frostnerd/dnschanger/DNSChanger.java
View file @
ac8bf2e0
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment