MCPcopy
hub / github.com/cortexlabs/cortex / WithStack

Function WithStack

pkg/lib/errors/error.go:51–71  ·  view source on GitHub ↗
(err error)

Source from the content-addressed store, hash-verified

49}
50
51func WithStack(err error) error {
52 if err == nil {
53 return nil
54 }
55
56 cortexError := getCortexError(err)
57
58 if cortexError == nil {
59 cortexError = &Error{
60 Kind: ErrNotCortexError,
61 Message: strings.TrimSpace(err.Error()),
62 Cause: err,
63 }
64 }
65
66 if cortexError.stack == nil {
67 cortexError.stack = callers()
68 }
69
70 return cortexError
71}
72
73func Wrap(err error, strs ...string) error {
74 if err == nil {

Callers 15

ErrorClusterDoesNotExistFunction · 0.92
validateCIDRFunction · 0.92
validateVPCCIDRFunction · 0.92
AddNewPolicyVersionFunction · 0.92
ErrorInvalidProviderFunction · 0.92
ErrorDisallowedFieldFunction · 0.92
ErrorInvalidRegionFunction · 0.92

Calls 3

getCortexErrorFunction · 0.85
callersFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected