MCPcopy
hub / github.com/pocketbase/pocketbase / Is

Method Is

tools/router/error.go:55–64  ·  view source on GitHub ↗

Is reports whether the current ApiError wraps the target.

(target error)

Source from the content-addressed store, hash-verified

53
54// Is reports whether the current ApiError wraps the target.
55func (e *ApiError) Is(target error) bool {
56 err, ok := e.rawData.(error)
57 if ok {
58 return errors.Is(err, target)
59 }
60
61 apiErr, ok := target.(*ApiError)
62
63 return ok && e == apiErr
64}
65
66// NewNotFoundError creates and returns 404 ApiError.
67func NewNotFoundError(message string, rawErrData any) *ApiError {

Callers 15

TestFileSystemAttributesFunction · 0.80
TestFileSystemDeleteFunction · 0.80
TestFileSystemGetReaderFunction · 0.80
ListMethod · 0.80
DeletePrefixMethod · 0.80
IsEmptyDirMethod · 0.80
ExistsMethod · 0.80
wrapErrorFunction · 0.80
NormalizeErrorMethod · 0.80
TestDriverNormilizeErrorFunction · 0.80
TestDriverNewRangeReaderFunction · 0.80
UploadMethod · 0.80

Calls

no outgoing calls

Tested by 12

TestFileSystemAttributesFunction · 0.64
TestFileSystemDeleteFunction · 0.64
TestFileSystemGetReaderFunction · 0.64
TestDriverNormilizeErrorFunction · 0.64
TestDriverNewRangeReaderFunction · 0.64
testEventResponseWriteFunction · 0.64
TestRereadableReadCloserFunction · 0.64
TestApiErrorIsFunction · 0.64