* If called within a [request.processFunc](FetchRequest-processFunc) * call, causes the request to retry as if throttled for %%stall%% * milliseconds.
(message?: string, stall?: number)
| 890 | * milliseconds. |
| 891 | */ |
| 892 | throwThrottleError(message?: string, stall?: number): never { |
| 893 | if (stall == null) { |
| 894 | stall = -1; |
| 895 | } else { |
| 896 | assertArgument(Number.isInteger(stall) && stall >= 0, "invalid stall timeout", "stall", stall); |
| 897 | } |
| 898 | |
| 899 | const error = new Error(message || "throttling requests"); |
| 900 | |
| 901 | defineProperties(<ThrottleError>error, { stall, throttle: true }); |
| 902 | |
| 903 | throw error; |
| 904 | } |
| 905 | |
| 906 | /** |
| 907 | * Get the header value for %%key%%, ignoring case. |
no test coverage detected