Fields implements the log.Fielder interface.
()
| 65 | |
| 66 | // Fields implements the log.Fielder interface. |
| 67 | func (e *Error) Fields() map[string]any { |
| 68 | if e == nil { |
| 69 | return nil |
| 70 | } |
| 71 | res := make(map[string]any) |
| 72 | pref := "error_cause" |
| 73 | for cause := Cause(e); cause != nil; cause = Cause(cause) { |
| 74 | res[pref] = cause.Error() |
| 75 | pref += "_cause" |
| 76 | } |
| 77 | maps.Copy(res, Attributes(Stack(e)...)) |
| 78 | return res |
| 79 | } |
| 80 | |
| 81 | // Interface is the interface of an error. |
| 82 | type Interface interface { |
nothing calls this directly
no test coverage detected