MCPcopy Create free account
hub / github.com/PageLeay/celestial-runtime / throwThrottleError

Method throwThrottleError

src.ts/utils/fetch.ts:892–904  ·  view source on GitHub ↗

* If called within a [request.processFunc](FetchRequest-processFunc) * call, causes the request to retry as if throttled for %%stall%% * milliseconds.

(message?: string, stall?: number)

Source from the content-addressed store, hash-verified

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.

Callers 1

fetchMethod · 0.45

Calls 2

assertArgumentFunction · 0.90
definePropertiesFunction · 0.90

Tested by

no test coverage detected