Skip to content

Commit

Permalink
fix: stop reporting storage access exceptions to acrarium
Browse files Browse the repository at this point in the history
these no longer generate useful reports
  • Loading branch information
mikehardy authored and david-allison committed Nov 25, 2024
1 parent 83b75bf commit ed407bb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion AnkiDroid/src/main/java/com/ichi2/anki/CoroutineHelpers.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import androidx.lifecycle.viewModelScope
import anki.collection.Progress
import com.ichi2.anki.CollectionManager.TR
import com.ichi2.anki.CollectionManager.withCol
import com.ichi2.anki.exception.StorageAccessException
import com.ichi2.anki.snackbar.showSnackbar
import com.ichi2.libanki.Collection
import com.ichi2.utils.message
Expand Down Expand Up @@ -169,8 +170,9 @@ suspend fun <T> FragmentActivity.runCatching(
Timber.w(exc, errorMessage)
exc.localizedMessage?.let { showSnackbar(it) }
}
is BackendNetworkException, is BackendSyncException -> {
is BackendNetworkException, is BackendSyncException, is StorageAccessException -> {
// these exceptions do not generate worthwhile crash reports
Timber.i("Showing error dialog but not sending a crash report.")
showError(this, exc.localizedMessage!!, exc, false)
}
is BackendException -> {
Expand Down
6 changes: 6 additions & 0 deletions AnkiDroid/src/main/java/com/ichi2/anki/InitialActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import androidx.annotation.RequiresApi
import androidx.appcompat.app.AlertDialog
import androidx.core.content.edit
import androidx.core.content.pm.PackageInfoCompat
import com.ichi2.anki.exception.StorageAccessException
import com.ichi2.anki.servicelayer.PreferenceUpgradeService
import com.ichi2.anki.servicelayer.PreferenceUpgradeService.setPreferencesUpToDate
import com.ichi2.anki.servicelayer.ScopedStorageService.isLegacyStorage
Expand Down Expand Up @@ -68,6 +69,11 @@ object InitialActivity {
} catch (e: SQLiteFullException) {
Timber.w(e)
StartupFailure.DISK_FULL
} catch (e: StorageAccessException) {
// Same handling as the fall through, but without the exception report
// These are now handled with a dialog and don't generate actionable reports
Timber.w(e)
StartupFailure.DB_ERROR
} catch (e: Exception) {
Timber.w(e)
CrashReportService.sendExceptionReport(e, "InitialActivity::getStartupFailureType")
Expand Down

0 comments on commit ed407bb

Please sign in to comment.