mirror of
https://github.com/GoogleContainerTools/kaniko.git
synced 2026-06-15 13:24:32 +00:00
* Bump github.com/docker/docker to latest release * Pin deps to docker/docker's requirements fix build breakages fix unit test Trying to see whether am-i-in-a-container checks are broken for integration tests...
18 lines
431 B
Go
18 lines
431 B
Go
package oc
|
|
|
|
import (
|
|
"go.opencensus.io/trace"
|
|
)
|
|
|
|
// SetSpanStatus sets `span.SetStatus` to the proper status depending on `err`. If
|
|
// `err` is `nil` assumes `trace.StatusCodeOk`.
|
|
func SetSpanStatus(span *trace.Span, err error) {
|
|
status := trace.Status{}
|
|
if err != nil {
|
|
// TODO: JTERRY75 - Handle errors in a non-generic way
|
|
status.Code = trace.StatusCodeUnknown
|
|
status.Message = err.Error()
|
|
}
|
|
span.SetStatus(status)
|
|
}
|