Extracts a Retry-After delay, in milliseconds, from a thrown error or a failed response.
Walks the shapes HTTP clients actually throw: the error itself carrying headers, an axios-style
error.response.headers, and one level of error.cause (how a wrapper preserves the original).
Parameters
error: unknown
the thrown value
nowMs: number = ...
clock reading for HTTP-date conversion; injectable for tests
Returns number
milliseconds to wait, or undefined when no usable header is present
Extracts a
Retry-Afterdelay, in milliseconds, from a thrown error or a failed response.Walks the shapes HTTP clients actually throw: the error itself carrying
headers, an axios-styleerror.response.headers, and one level oferror.cause(how a wrapper preserves the original).