3 ms·
You can enrich err.Error(), but when you do you lose the type of the original error and any other fields it may have had. This is something the language can and
by erik_seaberg 8y ago
You can enrich err.Error(), but when you do you lose the type of the original error and any other fields it may have had. This is something the language can and should do more reliably (i.e., sugar could mutate err.Error() and prepend "MyStruct.myMethod failed: ", or better yet add a damn stack trace).