MCPcopy Index your code
hub / github.com/cockroachdb/errors / IsTimeout

Function IsTimeout

oserror/oserror.go:113–120  ·  view source on GitHub ↗

IsTimeout returns a boolean indicating whether the error is known to report that a timeout occurred. This function differs from os.IsTimeout() in that it can identify an error through wrapping layers.

(err error)

Source from the content-addressed store, hash-verified

111// This function differs from os.IsTimeout() in that it
112// can identify an error through wrapping layers.
113func IsTimeout(err error) bool {
114 // os.IsTimeout() cannot peek through Unwrap. We need errors.If()
115 // for that.
116 _, ok := errors.If(err, func(err error) (interface{}, bool) {
117 return nil, os.IsTimeout(err)
118 })
119 return ok
120}

Callers 3

TestAdaptErrnoFunction · 0.92
TestErrorPredicatesUnixFunction · 0.85
TestErrorPredicatesFunction · 0.85

Calls 1

IfFunction · 0.92

Tested by 3

TestAdaptErrnoFunction · 0.74
TestErrorPredicatesUnixFunction · 0.68
TestErrorPredicatesFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…