Prompt Buddy logoPrompt Buddy

cloudflare · Cloudflare Workers Docs

Workers Errors and exceptions

Explains common Cloudflare Workers error codes, runtime exceptions like loop limits and unresolved promises, and specific failure scenarios such as WebSocket connection issues and I/O restrictions.

Import to Prompt Buddy

Derived skill

Files assembled from official documentation

Viewing SKILL.md

Workers Errors and exceptions

Explains common Cloudflare Workers error codes, runtime exceptions like loop limits and unresolved promises, and specific failure scenarios such as WebSocket connection issues and I/O restrictions.

When To Use

Use when diagnosing specific Cloudflare Worker error codes, resolving infinite loop limits, or debugging why a script fails to return a response due to event loop issues.

Reference Files

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/workers-observability-errors-and-exceptions-workflow-guide.mdA guide detailing common error pages, loop limits, unresolved promises, and error handling within Cloudflare Workers.Questions about a guide detailing common error pages, loop limits, unresolved promises, and error handling within Cloudflare Workers.
examples/workers-observability-errors-and-exceptions-cloudflare-workers-unresolve.textA JavaScript code example demonstrating how the Cloudflare Workers runtime throws an error when a fetch handler returns a promise that never resolves.Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how the Cloudflare Workers runtime throws an error when a fetch handler retur...
examples/workers-observability-errors-and-exceptions-cloudflare-workers-websocket.textA JavaScript code example demonstrating how a missing server.close() call in a WebSocket event listener causes a script to never generate a response error.Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how a missing server.close() call in a WebSocket event listener causes a scri...
examples/workers-observability-errors-and-exceptions-cloudflare-workers-error-han.textA JavaScript code example demonstrating how destructuring the context object in a Cloudflare Worker causes waitUntil to lose its 'this' reference and throw an error.Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how destructuring the context object in a Cloudflare Worker causes waitUntil...
examples/workers-observability-errors-and-exceptions-cloudflare-workers-ctx-waitu.textA JavaScript code example demonstrating how to avoid errors when calling the ctx.waitUntil method by using direct calls or re-binding the context.Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to avoid errors when calling the ctx.waitUntil method by using direct cal...
examples/workers-observability-errors-and-exceptions-cloudflare-workers-io-reques.textAn example of an uncaught error occurring when attempting to perform I/O on behalf of a different request in a Cloudflare Worker.Exact payloads, commands, or snippets shown in An example of an uncaught error occurring when attempting to perform I/O on behalf of a different request in a Cloudf...
examples/workers-observability-errors-and-exceptions-cloudflare-workers-error-han-2.textA JavaScript code example demonstrating a Workers error case where a response is returned after an asynchronous delay that exceeds the execution limit.Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating a Workers error case where a response is returned after an asynchronous delay...
examples/workers-observability-errors-and-exceptions-cloudflare-workers-error-han-3.textA JavaScript code example demonstrating how to handle errors and exceptions within a Cloudflare Workers fetch handler.Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to handle errors and exceptions within a Cloudflare Workers fetch handler.
examples/workers-observability-errors-and-exceptions-cloudflare-workers-ctx-waitu-2.textA JavaScript code example demonstrating how to use ctx.waitUntil() to ensure error logs are successfully sent to an external service during a Worker execution.Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to use ctx.waitUntil() to ensure error logs are successfully sent to an e...
examples/workers-observability-errors-and-exceptions-cloudflare-workers-event-wai.textA JavaScript code example demonstrating how to use event.waitUntil() to ensure error logging completes during a Cloudflare Workers fetch event.Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to use event.waitUntil() to ensure error logging completes during a Cloud...
examples/workers-observability-errors-and-exceptions-cloudflare-workers-passthrou.textA JavaScript code example demonstrating the use of the ctx.passThroughOnException() method to return the origin response when a Worker encounters an error.Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating the use of the ctx.passThroughOnException() method to return the origin respo...
examples/workers-observability-errors-and-exceptions-cloudflare-workers-exception.textA JavaScript code example demonstrating how to use event.passThroughOnException() to return the origin response when a Worker encounters an error.Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to use event.passThroughOnException() to return the origin response when...

What This Skill Covers

  • Review Workers errors and exceptions.
  • Main sections: Error pages generated by Workers, Loop limit, "The script will never generate a response" errors, Cause 1: Unresolved Promises, Cause 2: WebSocket connections that are never closed.

Workflow

  1. Open the most relevant file under docs/ for the exact documented workflow and wording.
  2. Open schemas/ files for exact structured contracts.
  3. Open examples/ files for concrete requests, commands, snippets, and manifests.
  4. Do not add behavior or configuration that is not present in the attached source files.

Canonical source: https://developers.cloudflare.com/workers/observability/errors