Skip to content

[#709] Fix error handling in morley-client

Description

Problem: There's a bug in handleOperationResult that might throw away useful information about the error reason.

Solution: Rewrite it. Also remove redundant combineResults. The trick is to collect all RunErrors and AppliedResults in the first pass, making note of whether we encountered OperationFailed at least once. If we did, handle the list of RunErrors. If we didn't, return the list of AppliedResults. This is somewhat complicated by the fact that we merge AppliedResults within one operation, but not between operations.

Related issue(s)

Resolves #709 (closed), supersedes !1086 (closed)

Checklist for your Merge Request

Related changes (conditional)

  • Tests (see short guidelines)

    • If I added new functionality, I added tests covering it.
    • If I fixed a bug, I added a regression test to prevent the bug from silently reappearing again.
  • Documentation

    • I checked whether I should update the docs and did so if necessary:
    • I updated changelog files of all affected packages released to Hackage if my changes are externally visible.

Stylistic guide (mandatory)

Merge request reports

Loading