Closed Maelkum closed 3 years ago
Q: We could do the same in the retriever
and transactor
packages, who are two big "generators" of errors, and move errors strings to const
there too. Do you think we should do that?
For me, the "pro" is - no magic strings scattered throughout the code, "con" - I think it's more precise and easier for the reader to see what's wrong as it is now. It's closer to a log message or a fmt.Errorf
, and offers more details than a name of a const
.
Q: We could do the same in the
retriever
andtransactor
packages, who are two big "generators" of errors, and move errors strings toconst
there too. Do you think we should do that?
I'm in favour of using constant strings for error types or sentinel errors. For normal errors, it's not required.
Goal of this PR
Fixes #444
Checklist