Re:Declined Proposal: A built-in Go error check function, “try”
by asplake on Wednesday July 17, 2019 @12:54AM
(#20456584)
Doesn’t wrapping usually mean adding (semantic) information without changing the original?
[ Parent
| on HN ]
Re:Declined Proposal: A built-in Go error check function, “try”
by wvenable on Wednesday July 17, 2019 @11:57AM
(#20460852)
You no longer propagating the same error; if you were type-checking on network exceptions, for example, you would entirely miss it if it was wrapped in LibraryException instead.
Wrapping does have value if you are really adding useful information but the example here is just changing the type which really doesn't add anything useful.