Improve error handling in api.go #106

Open
opened 2021-09-30 12:58:27 +00:00 by i-norden · 1 comment
Member

We need to manage the bubbling up of multiple errors better. Most API methods have the propensity of having two errors to return at the end of the method: an error internal to the method itself and an error returned by a call out to a proxy client if there was an internal error. Right now we give precedence to the internal errors, but it would be better to track both (in []error), and on return concatenate both messages and return a composite error.

Additionally, for the the eth_call method, we have two more potential errors to track: the newRevertError and the result.Err. In this case it would be particularly helpful to expose all these errors, of which all 4 could potentially occur in a single call.

See https://github.com/vulcanize/ipld-eth-server/pull/105#discussion_r719370160

We need to manage the bubbling up of multiple errors better. Most API methods have the propensity of having two errors to return at the end of the method: an error internal to the method itself and an error returned by a call out to a proxy client if there was an internal error. Right now we give precedence to the internal errors, but it would be better to track both (in `[]error`), and on return concatenate both messages and return a composite error. Additionally, for the the `eth_call` method, we have two more potential errors to track: the `newRevertError` and the `result.Err`. In this case it would be particularly helpful to expose all these errors, of which all 4 could potentially occur in a single call. See https://github.com/vulcanize/ipld-eth-server/pull/105#discussion_r719370160
Owner

@dboreham @telackey If this has been resolved please close.

@dboreham @telackey If this has been resolved please close.
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cerc-io/ipld-eth-server#106
No description provided.