Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions app/src/main/java/com/itsaky/androidide/app/IDEApplication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -184,16 +184,24 @@ class IDEApplication : BaseApplication() {
thread: Thread,
exception: Throwable,
) {
if (isNonFatalGcCleanupFailure(exception)) {
logger.warn("Non-fatal: ZipFile GC cleanup failed with I/O error", exception)
return
}

if (isUserUnlocked) {
// we can access credential protected storage, delegate the job to
// to advanced crash handler
CredentialProtectedApplicationLoader.handleUncaughtException(thread, exception)
return
}

// we can only access device-protected storage, and are not allowed
// to show crash handler screen
// delegate the job to the basic crash handler
DeviceProtectedApplicationLoader.handleUncaughtException(thread, exception)
}

private fun isNonFatalGcCleanupFailure(exception: Throwable): Boolean {
if (exception !is java.io.UncheckedIOException) return false
return exception.stackTrace.any {
it.className.contains("CleanableResource") ||
it.className.contains("PhantomCleanable")
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class CachedJarFileSystem(
// This is called manually by the Java LSP
}

@Throws(IOException::class)
fun doClose() {
try {
super.close()
Expand Down