MCPcopy
hub / github.com/apache/devlake / newSingleCrdbError

Function newSingleCrdbError

backend/core/errors/crdb_impl.go:118–132  ·  view source on GitHub ↗
(t *Type, err error, message string, opts ...Option)

Source from the content-addressed store, hash-verified

116}
117
118func newSingleCrdbError(t *Type, err error, message string, opts ...Option) Error {
119 cfg := &Options{}
120 for _, opt := range opts {
121 opt(cfg)
122 }
123 cfg.stackOffset += 1
124 msg := &errMessage{}
125 if cast, ok := err.(*crdbErrorImpl); ok {
126 if t == Default { // inherit wrapped error's type
127 t = cast.GetType()
128 }
129 }
130 msg.addMessage(t, message)
131 return newCrdbError(t, err, msg, cfg)
132}
133
134func newCombinedCrdbError(t *Type, errs []error) Error {
135 msg := &errMessage{}

Callers 3

NewMethod · 0.85
WrapMethod · 0.85
wrapRawMethod · 0.85

Calls 3

addMessageMethod · 0.95
newCrdbErrorFunction · 0.85
GetTypeMethod · 0.65

Tested by

no test coverage detected