Hello there. I'm calling my own api for a healthcheck. Obviously getting a "ECONNREFUSED" error when the api isn't available. But I can't catch the error. Whatever and wherever I try to catch the error, it still throws Uncaught exception: Error: connect ECONNREFUSED 127.0.0.1:4000 at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1487:16)
This is basically what I'm doing, but the exception is still "uncaught":
try { await got.get("http://localhost:4000"); } catch(error) { console.log("TEST") }
What am I doing wrong here?
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too