From d86fec192c1fbd27c14b26fff61913f849c837a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=20Zakraj=C5=A1ek?= Date: Wed, 12 Jun 2024 09:55:56 +0200 Subject: [PATCH] Add AttrError --- event.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/event.go b/event.go index ea34129..21182fb 100644 --- a/event.go +++ b/event.go @@ -10,6 +10,7 @@ import ( var ( AttrDuration = "duration" + AttrError = "error" AttrErrorCause = "errorCause" AttrErrorStack = "errorStack" AttrHTTPMethod = "httpMethod" @@ -51,7 +52,7 @@ func (e *Event) GetAttr(key string) any { } func (e *Event) SetError(err error) { - e.SetAttr("error", err) + e.SetAttr(AttrError, err) if _, ok := err.(xerrors.Wrapper); ok { e.SetAttr(AttrErrorStack, fmt.Sprintf("%+v", err))