mirror of
https://github.com/corda/corda.git
synced 2025-03-15 08:41:04 +00:00
CORDA-3309: Remove explicit try-catch in favour of UncaughtExceptionHandler. (#91)
This commit is contained in:
parent
90c2f7f129
commit
83ad11f21b
@ -92,18 +92,14 @@ abstract class TestBase(type: SandboxType) {
|
||||
) {
|
||||
var thrownException: Throwable? = null
|
||||
thread(start = false) {
|
||||
try {
|
||||
UserPathSource(classPaths).use { userSource ->
|
||||
SandboxRuntimeContext(parentConfiguration.createChild(userSource, Consumer {
|
||||
it.withNewMinimumSeverityLevel(minimumSeverityLevel)
|
||||
.withSandboxOnlyAnnotations(sandboxOnlyAnnotations)
|
||||
.withVisibleAnnotations(visibleAnnotations)
|
||||
})).use {
|
||||
action(this)
|
||||
}
|
||||
UserPathSource(classPaths).use { userSource ->
|
||||
SandboxRuntimeContext(parentConfiguration.createChild(userSource, Consumer {
|
||||
it.withNewMinimumSeverityLevel(minimumSeverityLevel)
|
||||
.withSandboxOnlyAnnotations(sandboxOnlyAnnotations)
|
||||
.withVisibleAnnotations(visibleAnnotations)
|
||||
})).use {
|
||||
action(this)
|
||||
}
|
||||
} catch (exception: Throwable) {
|
||||
thrownException = exception
|
||||
}
|
||||
}.apply {
|
||||
uncaughtExceptionHandler = Thread.UncaughtExceptionHandler { _, ex ->
|
||||
|
Loading…
x
Reference in New Issue
Block a user