How do i "force" exception for a request in javascript workers?

How do i “force” exception for a request in javascript workers?

i would like to force an exception so i can skip workers.
I’m doing so because there is an edge case where i “add to route” is not working for me

e.g. domain.com/search?q=* i want to use the script BUT
domain.com/searchisuser , i want to use the backend
but i cant do “add route” to workers for domain.com/search* <- this will not work since i cant do “?” matching too.

Attached code for reference

async function handleRequest(request) {
  const reqBody = await readRequestBody(request)
  const retBody = `The request body sent in was ${reqBody}`


  const url = new URL(request.url)
      if (url.pathname.indexOf("/login.php")) {
      console.log("i want to skip to the default backend")
      //how do i "force" a request to throw an exception so it will skip to default backend
    }


 
 return new Response(retBody)
}

A post was merged into an existing topic: How do I skip javascript workers processing when a condition is met?