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