More try-catch for getUpdate
This commit is contained in:
parent
503d5db16c
commit
a7d83782b6
1 changed files with 12 additions and 2 deletions
|
@ -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
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
|
Loading…
Reference in a new issue