Re:Gopher Wrangling. Effective error handling in Go
by jjnoakes on Tuesday June 20, 2023 @05:10PM
(#36410678)
I agree and I've been thinking about this in general (not only in the context of go, but for programming in general). I've settled on "caller adds context" because it is only the caller who knows if the error can be handled immediately (in which case no context is needed and we save the extra effort of creating it) or if the error should be propagated up, and how (should it be wrapped with context, wrapped in another struct, replaced with a different struct, etc).
[ Parent
| on HN ]
There are no comments on this comment yet.