Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to catch error #8

Open
notacircle opened this issue Jul 13, 2024 · 0 comments
Open

Unable to catch error #8

notacircle opened this issue Jul 13, 2024 · 0 comments

Comments

@notacircle
Copy link

Im just writing an app with typescript. I have a bad restricted connection so not all requests end with success in a first attempt.

For some reason I can't catch such network errors with try-catch clause:

node:internal/errors:787
  const ex = new Error(msg);
             ^

Error: socket hang up
    at connResetException (node:internal/errors:787:14)
    at TLSSocket.socketOnEnd (node:_http_client:519:23)
    at TLSSocket.emit (node:events:530:35)
    at endReadableNT (node:internal/streams/readable:1696:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  code: 'ECONNRESET'
}

It catches globally, not from the synchronous code flow.

You cat reproduce such errors with while(true) await outline.createUser(); and simulating bad connection.

Can't obtain from which section of code this throws because the stack trace is uninformative.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant