Thanks for still thinking about it.

Thanks for still thinking about it. Unfortunately, that doesn't work or not at least locally.
It does not return anything as the fetch never completes, so the function just shows 500 internal error on the server but doesn't execute any further. I tried shortcircuit with datares.status to check for 500 but it doesn't work that way as by that time the function errors out and not the origin server (for which datares checks for).
The 500 error is the function error but nothing is checking for the function error itself.
I am not sure if I am explaining it well.

I found out this, apparently the 500 error will only be returned if its timeout by due to DNS error https://community.cloudflare.com/t/community-tip-fixing-error-500-internal-server-error/44453 but other reasons it will not return anything like in my case where the origin server does not respond. The linked docs page in that article seems helpful for all the possible CF error codes
Was this page helpful?