MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / build

Function build

pkg/errors/errors.go:98–111  ·  view source on GitHub ↗

build an error from the definition, skipping the first frames of the call stack.

(d *Definition, skip int)

Source from the content-addressed store, hash-verified

96
97// build an error from the definition, skipping the first frames of the call stack.
98func build(d *Definition, skip int) *Error {
99 e := Error{
100 Definition: d,
101 grpcStatus: new(atomic.Value),
102 }
103 if generateCorrelationIDs {
104 u := uuid.New()
105 e.correlationID = hex.EncodeToString(u[:])
106 }
107 if skip > 0 {
108 e.stack = callers(skip)
109 }
110 return &e
111}
112
113// New exists in order to prevent accidentally calling Definition.New().
114// If you are sure that you want to create a fresh error, use .Definition.New().

Callers 9

buildMetadataComparatorFunction · 0.85
FromGRPCStatusFunction · 0.85
FromHTTPStatusCodeFunction · 0.85
WithCauseMethod · 0.85
WithDetailsMethod · 0.85
WithAttributesMethod · 0.85
FromFunction · 0.85
NewMethod · 0.85
NewFunction · 0.85

Calls 2

callersFunction · 0.85
NewMethod · 0.65

Tested by

no test coverage detected