def KErr.retryable

bend-kube-runtime@0.2.0.0 · src/client.bend:42

import bend-kube-runtime@0.2.0.0/src/client.bend as Client
import Base
import bend-kube-runtime@0.2.0.0/src/core.bend as C

42# Whether a failed call is worth retrying: the network, 429 (API priority
43# and fairness), and 5xx. 4xx answers are final.
44def KErr.retryable(e: KErr) -> Bool:
45  match e:
46    case KNet{c, m}:
47      True{}
48    case KApi{C.Status{+c, r, m}}:
49      Bool.or(U32.is_eq(c, 429), U32.is_ge(c, 500))
50    case KDecode{m}:
51      False{}

Uses (6)

Used by (0)

No other definition uses this definition.