|
|
|
|
|
by binwiederhier
2609 days ago
|
|
As others have stated, this seems incredibly odd to me: > If the last argument is an error and the format string ends with ": %w", ... This seems like a magic-string kinda hack to me. I like the idea of wrapping errors so that you keep the stack and full context, especially since you may need additional structured data from all errors (e.g. DB error, access error, ...) to produce user facing messages, so IMHO the wrapping should be more explicit than just %w. |
|
(I'm not defending it so much as explaining it. I'm not sure how I feel about it myself.)