RecordError records an error on the span and sets its status to Error.
(span trace.Span, err error)
| 115 | |
| 116 | // RecordError records an error on the span and sets its status to Error. |
| 117 | func RecordError(span trace.Span, err error) { |
| 118 | if err != nil { |
| 119 | span.RecordError(err) |
| 120 | span.SetStatus(codes.Error, err.Error()) |
| 121 | } |
| 122 | } |