-
-
Notifications
You must be signed in to change notification settings - Fork 935
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
Async Stacktrace lost on HTTPError #447
Comments
@brandon93s No and yes. No, because the stacktrace should show more details. It's because const EventEmitter = require('events');
const givesPromise = () => new Promise((resolve, reject) => {
const ee = new EventEmitter();
ee.once('error', e => {
reject(e);
});
// ee.emit('error', new Error('stacktrace not lost')); return; // uncomment this line and you'll see it gives more info
setImmediate(async _ => {
ee.emit('error', new Error('stacktrace lost'));
})
});
(async function() {
try {
await givesPromise();
} catch (e) {
console.log(e);
}
})(); |
Relevant Node.js issue: nodejs/node#11865 |
1 task
4 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The async stacktrace isn't very helpful when an
HTTPError
is thrown. On the other hand a timeout which throws aRequestError
keeps the relevant stack info.Here is example code that runs on Node 8:
The text was updated successfully, but these errors were encountered: