More try-catch for getUpdate

This commit is contained in:
June 2022-12-03 15:29:16 +01:00 committed by GitHub
parent 503d5db16c
commit a7d83782b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -196,6 +196,11 @@ class CastingHarness private constructor(
)
}
} catch (mishap: Mishap) {
val operator = try {
getOperatorForPattern(iota, world)
} catch (e: Throwable) {
null
}
return CastResult(
continuation,
null,
@ -205,7 +210,7 @@ class CastingHarness private constructor(
mishap,
Mishap.Context(
(iota as? PatternIota)?.pattern ?: HexPattern(HexDir.WEST),
getOperatorForPattern(iota, world)
operator
)
)
),
@ -214,6 +219,11 @@ class CastingHarness private constructor(
} catch (exception: Exception) {
// This means something very bad has happened
exception.printStackTrace()
val operator = try {
getOperatorForPattern(iota, world)
} catch (e: Throwable) {
null
}
return CastResult(
continuation,
null,
@ -223,7 +233,7 @@ class CastingHarness private constructor(
MishapError(exception),
Mishap.Context(
(iota as? PatternIota)?.pattern ?: HexPattern(HexDir.WEST),
getOperatorForPattern(iota, world)
operator
)
)
),