From a216c701ee4e256a433a55956a111dd3eb882358 Mon Sep 17 00:00:00 2001 From: Johan Brandhorst-Satzkorn Date: Wed, 9 Nov 2022 16:04:05 -0600 Subject: [PATCH] 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. --- internal/db/read_writer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/db/read_writer.go b/internal/db/read_writer.go index 508a8c714d..de58eb56a6 100644 --- a/internal/db/read_writer.go +++ b/internal/db/read_writer.go @@ -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())...) }