Client disconnections
# workers-help
s
it seems like a lot of clients are being disconnected. how can i debug / be able to properly handle that? can i respond with something right before its disconnected?

https://cdn.discordapp.com/attachments/1109085025988771890/1109085026248835112/Screenshot_2023-05-19_at_4.46.49_AM.png

i
If a client is disconnected there isn't any time to reply. This will happen, for example, if you make a request via
cURL
and then hit Control C in the middle of the request - since the request immediately exits the server doesn't have any chance to reply.
As for other clean-up work, you can try using waitUntil https://developers.cloudflare.com/workers/runtime-apis/fetch-event/#waituntil, which I think still runs even if the client disconnects (although I'm not certain about that).