From fa6d6eeec922da354e8dbfa7ff1b0c8618b1259e Mon Sep 17 00:00:00 2001 From: Deepankar Agrawal Date: Thu, 29 Jul 2021 17:58:45 +0530 Subject: [PATCH] add error util for both tag and extras --- errors/errors.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/errors/errors.go b/errors/errors.go index 8873dac..a2fccb6 100644 --- a/errors/errors.go +++ b/errors/errors.go @@ -130,6 +130,17 @@ func NewErrorWithExtras(_msg string, _cause error, _fatal bool, _extras map[stri return _err.WithStack(err) } +func NewErrorWithTagsAndExtras(_msg string, _cause error, _fatal bool, _tags map[string]string, _extras map[string]interface{}) error { + err := &rung{ + cause: _cause, + msg: _msg, + fatal: _fatal, + tags: _tags, + extras: _extras, + } + return _err.WithStack(err) +} + // NewErrorToIgnore returns an error that informs loggers to ignore it func NewErrorToIgnore(_msg string, _cause error) error { err := &rung{