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

SCP-2985: Contract errors are now logged when running the PAB. #297

Merged
merged 1 commit into from
Feb 7, 2022

Conversation

koslambrou
Copy link
Contributor

@koslambrou koslambrou commented Feb 4, 2022

Errors include uses of throwError inside a Contract and when decoding endpoint parameters.

Here are a few examples.

When a throwError is called in the Contract Monad:

[pab:Info:183] [2022-02-04 00:12:31.10 UTC] Initialising contract PayToWallet with ID 5822163d-4ed9-4b1d-84ba-742855fb4baa
[pab:Info:183] [2022-02-04 00:12:31.11 UTC] Activated instance 5822163d-4ed9-4b1d-84ba-742855fb4baa on W872cb83
[pab:Info:185] [2022-02-04 00:12:31.14 UTC] 5822163d-4ed9-4b1d-84ba-742855fb4baa: "Calling PayToWallet endpoint"
[pab:Error:185] [2022-02-04 00:12:31.14 UTC] 5822163d-4ed9-4b1d-84ba-742855fb4baa: {
    "contents": "THIS IS AN ERROR",
    "tag": "OtherError"
}

When the endpoint parameters could not be decoded (wrong JSON format):

[pab:Info:158] [2022-02-04 00:15:14.83 UTC] Initialising contract PayToWallet with ID 11d859ab-e0ca-40a3-ae68-db3d14320e31
[pab:Info:158] [2022-02-04 00:15:14.84 UTC] Activated instance 11d859ab-e0ca-40a3-ae68-db3d14320e31 on W872cb83
[pab:Error:160] [2022-02-04 00:15:14.87 UTC] 11d859ab-e0ca-40a3-ae68-db3d14320e31: {
    "contents": "Error in $.amount.getValue[0][1][0][0]: key \"unTokenName\" not found",
    "tag": "OtherError"
}

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

@koslambrou koslambrou requested a review from raduom February 4, 2022 00:26
Copy link
Contributor

@raduom raduom left a comment

Choose a reason for hiding this comment

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

LGTM

@koslambrou koslambrou merged commit 080463c into main Feb 7, 2022
@koslambrou koslambrou deleted the scp-2985 branch February 7, 2022 14:19
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