Extracts the configured timeout duration (in ms) from a timeout-related error,
if available. Returns undefined when the duration cannot be determined.
Prefers structured details.timeoutMs metadata on APIError(408) (set by
baseClient.toAPIError), falling back to regex on the error message.
Recurses into Error.cause chains.
Parameters
error: unknown
A timeout-related error
Returns number|undefined
The timeout duration in milliseconds, or undefined
Extracts the configured timeout duration (in ms) from a timeout-related error, if available. Returns
undefinedwhen the duration cannot be determined.Prefers structured
details.timeoutMsmetadata onAPIError(408)(set bybaseClient.toAPIError), falling back to regex on the error message. Recurses intoError.causechains.