Skip to content

Commit 3f329cc

Browse files
authored
fix(functions): add RateLimitError in Deno.errors namespace (#2160)
1 parent 280e453 commit 3f329cc

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

packages/core/functions-js/src/edge-runtime.d.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,5 +194,15 @@ declare namespace Deno {
194194
export namespace errors {
195195
class WorkerRequestCancelled extends Error {}
196196
class WorkerAlreadyRetired extends Error {}
197+
198+
/** Thrown when an outbound HTTP request is blocked by the rate limiter. */
199+
class RateLimitError extends Error {
200+
/**
201+
* Number of milliseconds until the rate-limit window resets.
202+
* `null` if the reset time could not be determined.
203+
*/
204+
retryAfterMs: number | null;
205+
constructor(message: string, retryAfterMs?: number);
206+
}
197207
}
198208
}

0 commit comments

Comments
 (0)