feature (errors): add support fmt specifier with operands to WithMsg(...) (#2126)

This commit is contained in:
Jim authored and GitHub committed 2022-06-03 10:38:32 -04:00
1 parent 2a5aaea8b2
commit 6ceda0e595
3 files changed
+13 -3

No files matched your search

+1 -1
View File
@@ -74,7 +74,7 @@ func E(ctx context.Context, opt ...Option) error {
Code: code,
Op: opts.withOp,
Wrapped: opts.withErrWrapped,
Msg: opts.withErrMsg,
Msg: fmt.Sprintf(opts.withErrMsg, opts.withErrMsgArgs...),
}
if opts.withoutEvent {
return err