Skip to content

Commit

Permalink
Do not report errors related to broken file system.
Browse files Browse the repository at this point in the history
  • Loading branch information
zamojski committed Jul 3, 2022
1 parent 664eda2 commit 3b3058d
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public void uncaughtException(@NotNull Thread thread, @NotNull Throwable ex) {
}
// strange but it happens that app is tested on devices with lower SDK - don't send ACRA reports
// also ignore errors caused by system failures
if (isSdkVersionSupported() && !hasSystemDied(ex) && !isAndroid10TelephonyManagerLambdaBug(ex)) {
if (isSdkVersionSupported() && !hasSystemDied(ex) && !isAndroid10TelephonyManagerLambdaBug(ex) && !hasFileSystemInBadStage(ex)) {
if (isDatabaseCorrupted(ex)) {
String dbString = DatabaseOperations.getDatabaseBaseString(getApplication());
ACRA.getErrorReporter().putCustomData("DB", dbString);
Expand Down Expand Up @@ -143,6 +143,12 @@ private boolean isDatabaseCorrupted(Throwable ex) {
return isCorrupted;
}

private boolean hasFileSystemInBadStage(Throwable ex) {
boolean isType = ex instanceof IllegalStateException;
boolean isInBadState = ex.getMessage() != null && ex.getMessage().contains("The file system on the device is in a bad state.");
return isType && isInBadState;
}

private String getFullStackTrace(Throwable ex) {
try {
ByteArrayOutputStream stackTraceStream = new ByteArrayOutputStream();
Expand Down

0 comments on commit 3b3058d

Please sign in to comment.