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

Method WithCause

pkg/errors/causes.go:41–48  ·  view source on GitHub ↗

WithCause returns the error with the given cause set. Overwriting an existing cause in the Error will cause a panic.

(cause error)

Source from the content-addressed store, hash-verified

39// WithCause returns the error with the given cause set.
40// Overwriting an existing cause in the Error will cause a panic.
41func (e *Error) WithCause(cause error) *Error {
42 if e == nil {
43 return nil
44 }
45 dup := *e
46 dup.setCause(cause)
47 return &dup
48}
49
50// WithCause returns a new error from the definition, and sets the cause of the error.
51func (d *Definition) WithCause(cause error) *Error {

Callers 15

FromFunction · 0.95
FileMethod · 0.45
FileMethod · 0.45
FileMethod · 0.45
readMethod · 0.45
appendMethod · 0.45
AppendFHDRFunction · 0.45
UnmarshalFHDRFunction · 0.45
AppendMACPayloadFunction · 0.45
UnmarshalMACPayloadFunction · 0.45
AppendJoinAcceptPayloadFunction · 0.45

Calls 1

setCauseMethod · 0.80

Tested by 12

TestGetNwkSKeysFunction · 0.36
TestGetAppSKeyFunction · 0.36
TestGetHomeNetIDFunction · 0.36
TestHandleDLChannelAnsFunction · 0.36
TestCodesFunction · 0.36
TestGRPCConversionFunction · 0.36
ExampleFunction · 0.36
TestFieldsFunction · 0.36
TestCauseFunction · 0.36
TestResemblesFunction · 0.36