MCPcopy Create free account
hub / github.com/foxcpp/maddy / IsTemporaryOrUnspec

Function IsTemporaryOrUnspec

framework/exterrors/temporary.go:33–39  ·  view source on GitHub ↗

IsTemporaryOrUnspec is similar to IsTemporary except that it returns true if error does not have a Temporary() method. Basically, it assumes that errors are temporary by default compared to IsTemporary that assumes errors are permanent by default.

(err error)

Source from the content-addressed store, hash-verified

31// errors are temporary by default compared to IsTemporary that assumes
32// errors are permanent by default.
33func IsTemporaryOrUnspec(err error) bool {
34 var temp TemporaryErr
35 if errors.As(err, &temp) {
36 return temp.Temporary()
37 }
38 return true
39}
40
41// IsTemporary returns true whether the passed error object
42// have a Temporary() method and it returns true.

Callers

nothing calls this directly

Calls 1

TemporaryMethod · 0.95

Tested by

no test coverage detected