MCPcopy Index your code
hub / github.com/twitchtv/twirp / Errorf

Method Errorf

errors.go:87–89  ·  view source on GitHub ↗

code.Errorf(msg, args...) builds a new Twirp error with code and formatted msg. The format may include "%w" to wrap other errors. Examples: twirp.Internal.Error("Oops: %w", originalErr) twirp.NotFound.Error("Resource not found with id: %q", resourceID)

(msgFmt string, a ...interface{})

Source from the content-addressed store, hash-verified

85// twirp.Internal.Error("Oops: %w", originalErr)
86// twirp.NotFound.Error("Resource not found with id: %q", resourceID)
87func (code ErrorCode) Errorf(msgFmt string, a ...interface{}) Error {
88 return NewErrorf(code, msgFmt, a...)
89}
90
91// WrapError allows Twirp errors to wrap other errors.
92// The wrapped error can be extracted later with (github.com/pkg/errors).Unwrap

Callers 15

TestServerOptionsReadOptFunction · 0.80
TestChainHooksFunction · 0.80
TestWithServerPathPrefixFunction · 0.80
TestWithJSONSkipDefaultsFunction · 0.80
TestErrorConstructorsFunction · 0.80
TestWithMetaRacesFunction · 0.80
TestPkgErrorCauseFunction · 0.80
TestWrapErrorFunction · 0.80
TestWriteErrorFunction · 0.80
assertTwirpErrorFunction · 0.80

Calls 1

NewErrorfFunction · 0.85

Tested by 15

TestServerOptionsReadOptFunction · 0.64
TestChainHooksFunction · 0.64
TestWithServerPathPrefixFunction · 0.64
TestWithJSONSkipDefaultsFunction · 0.64
TestErrorConstructorsFunction · 0.64
TestWithMetaRacesFunction · 0.64
TestPkgErrorCauseFunction · 0.64
TestWrapErrorFunction · 0.64
TestWriteErrorFunction · 0.64
assertTwirpErrorFunction · 0.64