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);
}
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.
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.