Fix fishy discards (#11197)

* dont discard errors

CHANGELOG_BEGIN
CHANGELOG_END

* remove redundant match case
This commit is contained in:
nickchapman-da 2021-10-12 12:18:34 +01:00 committed by GitHub
parent 9835ccb1ef
commit 9c107a7aa8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -330,15 +330,12 @@ class Engine(val config: EngineConfig = Engine.StableConfig) {
machine.run() match {
case SResultFinalValue(_) => finished = true
case SResultError(SError.SErrorDamlException(error)) =>
return ResultError(Error.Interpretation.DamlException(error), detailMsg)
case SResultError(err) =>
err match {
case SError.SErrorCrash(where, reason) =>
discard[Error.Interpretation.Internal](Error.Interpretation.Internal(where, reason))
case SError.SErrorDamlException(error) =>
discard[Error.Interpretation.DamlException](Error.Interpretation.DamlException(error))
return ResultError(Error.Interpretation.DamlException(error), detailMsg)
case SError.SErrorCrash(where, reason) =>
return ResultError(Error.Interpretation.Internal(where, reason))
}
case SResultNeedPackage(pkgId, context, callback) =>
return Result.needPackage(