forked from ethereum/go-ethereum
-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Labels
Category: Code quality ✏️Category: Documentation ✒️A problem with the readme or a code comment.A problem with the readme or a code comment.Complexity: 🟦 Easy to doPriority: 💤 Low priority
Description
Rationale
We should be able to quickly find where an error is coming from, and have a minimal context on what failed. To do so we can:
- use
fmt.Errorf("doing this: %s", err)
to wrap errors coming from 'below' layers - use
fmt.Errorf("failed this: some details context")
when creating an error, with necessary details
==
instead of errors.Is
otherwise it means we cannot add error context wrapping. In particular core/vm should be excluded.
Implementation
Check all *libevm*
files as well as geth original source files that were modified for:
- regex
return.+err
and add wrapping if appropriate - check other
return
statements in case we return the error directly without wrapping i.e.return f()
wheref
returns an error
ℹ️ Note we obviously don't want to modify parts we did not add on top of geth and that we did not modify in geth original code
Metadata
Metadata
Assignees
Labels
Category: Code quality ✏️Category: Documentation ✒️A problem with the readme or a code comment.A problem with the readme or a code comment.Complexity: 🟦 Easy to doPriority: 💤 Low priority