What you guys do to contextualize errors? I’m using pkg/errors
, it’s amazing. Today, i’m contextualizing all errors, so, whenever a function returns a error, i wrap and contextualize it.
The final messages make a lot of sense, i know exact where the problem is, but it is very verbose and annoying.
So when and how you guys contextualize the errors?
- on all errors
- only at the return of public methods/functions
- only when it’s handled
- i prefer to panic