mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-15 02:59:33 +07:00
IJPL-158517 ensure dumpCoroutines never throws
GitOrigin-RevId: e6217b2c4aa6c4ec1ec7f5f101a2d02e32356cce
This commit is contained in:
committed by
intellij-monorepo-bot
parent
6e41cff151
commit
d6190127db
@@ -48,6 +48,7 @@ fun enableCoroutineDump(): Result<Unit> {
|
||||
*/
|
||||
//@JvmOverloads
|
||||
fun dumpCoroutines(scope: CoroutineScope? = null, stripDump: Boolean = true, deduplicateTrees: Boolean = true): String? {
|
||||
try {
|
||||
if (!isCoroutineDumpEnabled()) {
|
||||
return null
|
||||
}
|
||||
@@ -58,6 +59,13 @@ fun dumpCoroutines(scope: CoroutineScope? = null, stripDump: Boolean = true, ded
|
||||
dumpCoroutines(jobTree, out, stripDump, deduplicateTrees)
|
||||
}
|
||||
return outputStream.toString(charset)
|
||||
} catch (e: Throwable) {
|
||||
// if there is an unexpected exception, we won't be able to provide meaningful information anyway,
|
||||
// but the exception should not prevent other diagnostic tools from collecting data
|
||||
return "Coroutine dump has failed: ${e.message}\n" +
|
||||
"Please report this issue to the developers.\n" +
|
||||
e.stackTraceToString()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user