Error 1101: Worker threw exception

My worker https://opticalinqustordonload.william-haskin25.workers.dev/ returns an error 1101: Worker threw exception page looking like this Cloudflare Ray ID and My IP have been blacked out for privacy reasons

It’s been doing this for awhile, I can’t get it to stop! It’s a coded worker (made within cloudflare) and I think the coding May have something to do with it
addEventListener(‘fetch’, event => {

event.respondWith(handleRequest(event.request))

})

/**

  • Respond to the request

  • @param {Request} request

*/

async function handleRequest(request) {

return new Response(‘Hello the site opticalinqustordonload.godaddysites.com is down due to a domain needing to be bought, sorry about that! If you were NOT trying to visit the site opticalinqustordonload.godaddysites.com, please close this tab and carry on!’, {status: unknown})

That’s the coding I din’t want to screenshot it, also their was only 1 successful access within the last 24 hours

And here is the last week


So OBVIOUSLY someone got on it successfully at around 3:00PM CST yesterday! But this started occurring right after I deployed the worker!
So, what can I do? What’s the problem? Anyone getting this error when accessing the worker?

If you are using Wrangler, you should be able to tail live logs using wrangler tail.

From a quick glance at the code, {status: unknown} is not valid JavaScript syntax, you need to place a numeric HTTP code there (200 for success, 400 for bad request, etc.).

Is the {status: unknown}) the cause?

I would assume so, yes, try {status: 200} or something similar.

What would be like an unknown error, which response returns unknown error I want to set that as the status code

Take your pick :smile:: https://httpstatuses.com/

Error codes are in the 4XX or 5XX range, so find one that fits your error and substitute that in.

Ok I’ll try 421 (misdirected request)

Hello, when I tried to deploy my worker (access it) it returned an error 522 Connection timed out. This same exact worker returned an error 1101: Worker threw exception (which I have fixed) But what the cause of this error 522!? Here’s an image of the error


The worker’s link is https://opticalinqustordonload.william-haskin25.workers.dev/ is anyone else getting this error, what should I try?