Getting 1011 errors on all my workers

What is the name of the domain?

workers.dev

What is the error number?

1011

What is the error message?

Worker threw exception

What is the issue you’re encountering

I cannot access any of my workers although they give 200 OK response when I am editing the code

Screenshot of the error

Hi,

When a Cloudflare Worker encounters an exception (e.g. an error/condition that wasn’t properly handled) it can cause your visitors to see an 1101 Error which will be presented with an HTTP 500 status code. You can find more on Cloudflare Worker error codes and invocation statuses at the links provided.

You can easily handle exceptions in your Worker code by using statements such as try…catch to ensure that if an exception is thrown in your code then it will be caught and handled gracefully.

For example, wrapping code that could trigger an exception as follows:

try 
{
  // potential exception in this code block
  myfunction();
} 
catch (error) 
{
  // if an exception was thrown, catch the error in this block
  console.error(error);
}

Alternatively, if you would rather pass the request onto the origin server in case of an exception, you would add the event.passThroughOnException() function to the Fetch addEventListener as shown below:

addEventListener("fetch", event => {
  event.passThroughOnException()
  event.respondWith(handleRequest(event.request))
})

Please keep in mind that while we are happy to help with troubleshooting the deployment of your Worker script, unfortunately, we cannot debug user code.

For further assistance, we suggest taking a look at our developer documentation or reach out on the community forums where other users and developers can help with your code:

Hi. I think this issue is with my subdomain due to which no workers are executing and giving the same error. I tried to create a new worker with the basic code below but it still resulted in the same error.

export default {
  async fetch(request, env, ctx) {
    return new Response('Hello World!');
  },
};

Note: I get a 200 OK response with text Hello World as long as I send the request through cloudflare edit code right panel which is available at ‘workers/services/edit/my-worker/production’
but I get a Worker threw exception: Error 1101 when I try to send the request through my browser.

This topic was automatically closed after 15 days. New replies are no longer allowed.