Skip to content

Commit

Permalink
adapters: remove never taken branch (#68)
Browse files Browse the repository at this point in the history
This code seems to be a copy-paste of code called in a `recover` func in
Sensor.WriteTracingSpan. In TracingHttpRequest `err` is known to be an
error so the first branch will always be taken.
  • Loading branch information
mmlb authored and pglombardo committed May 9, 2019
1 parent 0430c4a commit eff0fdf
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions adapters.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,7 @@ func (s *Sensor) TracingHttpRequest(name string, parent, req *http.Request, clie
span.SetTag(string(ext.HTTPStatusCode), res.StatusCode)

if err != nil {
if e, ok := err.(error); ok {
span.LogFields(otlog.Error(e))
} else {
span.LogFields(otlog.Object("error", err))
}
span.LogFields(otlog.Error(err))
}
return
}
Expand Down

0 comments on commit eff0fdf

Please sign in to comment.