neondatabase / serverless

Connect to Neon PostgreSQL from serverless/worker/edge functions
https://www.npmjs.com/package/@neondatabase/serverless
MIT License
321 stars 13 forks source link

fix: emit errors that happen before open event #23

Closed f0ssel closed 1 year ago

f0ssel commented 1 year ago

While using this library I noticed that network connection errors are currently not emitted or throw on new Client(addr). An example of this is a 500 http status code from the server. After some digging I realized that is because WebSocket connection errors that are emitted before the open are not surfaced to the serverless client.

jawj commented 1 year ago

Can I ask why you closed this?

f0ssel commented 1 year ago

Yeah I was working through a bug on my own code and I believe I opened this when I still didn't quite understand the problem 100%. I wasn't sure if this PR actually did anything so wanted to close before anyone spent time on it. I will reopen if I can confirm the issue.

jawj commented 1 year ago

OK, thanks.