Plutonomicon / cardano-transaction-lib

A Purescript library for building smart contract transactions on Cardano
https://plutonomicon.github.io/cardano-transaction-lib/
MIT License
93 stars 50 forks source link

Parse ogmios, ODC and ctl-server errors #479

Closed klntsky closed 2 years ago

klntsky commented 2 years ago

As for now, we ignore "fault" field in ogmios response, which results in parse errors like (AtKey "SubmitSuccess" MissingValue). API consumers asked us to handle errors more gracefully a number of times.

What to do:

For ODC:

Check fault field of response.

For Ogmios:

Handle "fault" field in response.

For ctl-server:

Make sure that all exceptions are handled and the output is actually JSON, not something like

The Plutus script evaluation failed: An error has occurred:  User error:
The provided Plutus code called 'error'.
Script debugging logs: 

Since we don't have designated types for errors, let's have a "catch all" case and return just the error message as JSON.

klntsky commented 2 years ago

Closed by #586 #584