mirror of
https://github.com/corda/corda.git
synced 2025-01-12 16:02:41 +00:00
CORDA-3309: Install UncaughtExceptionHandler for DJVM tasks. (#88)
This commit is contained in:
parent
ecc5ace4c7
commit
90c2f7f129
@ -91,7 +91,7 @@ abstract class TestBase(type: SandboxType) {
|
||||
action: SandboxRuntimeContext.() -> Unit
|
||||
) {
|
||||
var thrownException: Throwable? = null
|
||||
thread {
|
||||
thread(start = false) {
|
||||
try {
|
||||
UserPathSource(classPaths).use { userSource ->
|
||||
SandboxRuntimeContext(parentConfiguration.createChild(userSource, Consumer {
|
||||
@ -105,7 +105,13 @@ abstract class TestBase(type: SandboxType) {
|
||||
} catch (exception: Throwable) {
|
||||
thrownException = exception
|
||||
}
|
||||
}.join()
|
||||
}.apply {
|
||||
uncaughtExceptionHandler = Thread.UncaughtExceptionHandler { _, ex ->
|
||||
thrownException = ex
|
||||
}
|
||||
start()
|
||||
join()
|
||||
}
|
||||
throw thrownException ?: return
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user