3 ms·
I also panic whenever possible from the caller, in which case I get a pretty clear stack trace. I understand you don't always want that but imo I don't have a l
by nkozyra 5y ago
I also panic whenever possible from the caller, in which case I get a pretty clear stack trace. I understand you don't always want that but imo I don't have a lot of cases where I'm ultimately throwing my hands up on a non-exception error.
I think V2 errors are taking more of a lead from the pkg/errors error.Wrap approach anyway.
- preseinger 5y agopkg/errors.Wrap is already accomplished in the stdlib via fmt.Errorf("annotation: %w", err). Programs which use `panic` as ersatz error mechanisms are fundamentally broken. `panic` expresses an invariant violation that's much different than normal errors.