Silence events from DB errors (#2601) (#2602)

If callers want errors to create events, they can do so
by wrapping the error. Sometimes we don't want db
errors to be events, and before this there was no way
to supress them.
This commit is contained in:
Johan Brandhorst-Satzkorn authored and GitHub committed 2022-11-09 17:04:05 -05:00
1 parent ae28bf7838
commit a216c701ee
1 file changed
+1 -1
+1 -1
View File
@@ -543,5 +543,5 @@ func wrapError(ctx context.Context, err error, op string, errOpts ...errors.Opti
errOpts = append(errOpts, errors.WithCode(errors.InvalidFieldMask))
}
return errors.Wrap(ctx, err, errors.Op(op), errOpts...)
return errors.Wrap(ctx, err, errors.Op(op), append(errOpts, errors.WithoutEvent())...)
}