Skip to content
This repository has been archived by the owner on Dec 2, 2024. It is now read-only.

SCP-3331 Fixed error handling for transaction balancing in PAB. #360

Merged
merged 1 commit into from
Mar 15, 2022

Conversation

bwbush
Copy link
Collaborator

@bwbush bwbush commented Mar 15, 2022

The Cardano.Wallet.LocalClient.runClient' function erroneously rethrows errors it catches instead of returning them via pure . Left, as required by its type signature. The errors are not handled and end up killing the thread that handles the contract instance. This change successfully passes the Marlowe test https://github.com/input-output-hk/marlowe-cardano/blob/sprint-52/marlowe-cli/test/test-wallet-failure.yaml.

(In general, I recommend reviewing the PAB codebase for similar re-throwing problems and for forkIOs that aren't guarded against its thread dying because of an uncaught exception.)

Pre-submit checklist:

  • Branch
    • Tests are provided (if possible)
    • Commit sequence broadly makes sense
    • Key commits have useful messages
    • Relevant tickets are mentioned in commit messages
    • Formatting, materialized Nix files, PNG optimization, etc. are updated
  • PR
    • Self-reviewed the diff
    • Useful pull request description
    • Reviewer requested

The `Cardano.Wallet.LocalClient.runClient'` function erroneously
rethrows errors it catches instead of returning them via
`pure . Left`. The errors are not handled and end up killing the
thread that handles the contract instance.
Copy link
Contributor

@sjoerdvisscher sjoerdvisscher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, nice catch!

@sjoerdvisscher sjoerdvisscher merged commit 2a40552 into main Mar 15, 2022
@sjoerdvisscher sjoerdvisscher deleted the SCP-3331 branch March 15, 2022 12:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants