The @forge/events
package exports asynchronous event errors. The following example shows how the package handles rate limit errors:
1 2import { RateLimitError } from '@forge/events'; try { const queue = new Queue({ key: "queue-name"}); queue.push(["/* payload for this event */"]); } catch (error) { if (error instanceof RateLimitError) { // Handle rate limit error } }
Error type | Description |
---|---|
PartialSuccessError | Some pushed events were not recorded for later processing. Each event can have a different reason for failure. To get error details for failed events, inspect the error's failedEvents property here.
|
RateLimitError | The total number of events pushed per minute exceeds the defined limits. To overcome this, retry adding events after a minute. |
TooManyEventsError | More than 50 events were pushed to the queue in a single request. See Async events limits for more details about this limit. |
PayloadTooBigError | The combined payload of events pushed in a single request exceeded 200 KB. See Async events limits for more details about this limit. |
InvalidQueueNameError | The queue name is invalid. A valid queue name is alphanumeric string, and can start with _ . |
InvocationLimitReachedError | An event resolver can push more events to the queue, creating a cycle. This error means an event pushed another event into the queue more than 1000 times. To avoid this, process more events in parallel. See Async events limits for more details about this limit. |
Rate this page: