Skip to content

Commit

Permalink
add error util for both tag and extras
Browse files Browse the repository at this point in the history
  • Loading branch information
deep110 committed Jul 29, 2021
1 parent 437b8a2 commit fa6d6ee
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions errors/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit fa6d6ee

Please sign in to comment.