Worker Error 1101

Hello I have the error 1101 in my worker from this javascript code

Hi @alikhosroshahi85

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:

  // potential exception in this code block
catch (error) 
  // if an exception was thrown, catch the error in this block

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 => {

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:

Hopefully this helps but do let us know of further questions here.