MCPcopy
hub / github.com/vitessio/vitess / Errorf

Function Errorf

go/vt/vterrors/vterrors.go:143–149  ·  view source on GitHub ↗

Errorf formats according to a format specifier and returns the string as a value that satisfies error. Errorf also records the stack trace at the point it was called. Use this for Vitess-specific errors that don't have a MySQL counterpart

(code vtrpcpb.Code, format string, args ...any)

Source from the content-addressed store, hash-verified

141// Errorf also records the stack trace at the point it was called.
142// Use this for Vitess-specific errors that don't have a MySQL counterpart
143func Errorf(code vtrpcpb.Code, format string, args ...any) error {
144 return &fundamental{
145 msg: fmt.Sprintf(format, args...),
146 code: code,
147 stack: callers(),
148 }
149}
150
151// NewErrorf formats according to a format specifier and returns the string
152// as a value that satisfies error.

Callers 15

TestBackupFunction · 0.92
WriteComBinlogDumpMethod · 0.92
WritePacketDirectMethod · 0.92
StripChecksumMethod · 0.92
query.goFile · 0.92
ReadQueryResultMethod · 0.92
readComQueryResponseMethod · 0.92
writeColumnDefinitionMethod · 0.92
handleMethod · 0.92
writeHandshakeV10Method · 0.92

Calls 1

callersFunction · 0.85

Tested by 15

TestBackupFunction · 0.74
TestErrorCodesFunction · 0.74
TestNewSQLErrorFromErrorFunction · 0.74
CreateMethod · 0.74
UpdateMethod · 0.74
DeleteMethod · 0.74
LockMethod · 0.74
LockWithTTLMethod · 0.74
LockNameMethod · 0.74
TryLockMethod · 0.74
TestIsUnrecoverableErrorFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…