Skip to content

Commit

Permalink
Add AttrError
Browse files Browse the repository at this point in the history
  • Loading branch information
bancek committed Jun 12, 2024
1 parent cbc81ec commit d86fec1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion event.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (

var (
AttrDuration = "duration"
AttrError = "error"
AttrErrorCause = "errorCause"
AttrErrorStack = "errorStack"
AttrHTTPMethod = "httpMethod"
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit d86fec1

Please sign in to comment.