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
no stacktrace #1736
Comments
e.stack is just
anyone know where the correct stacktrace is stored? for illustration purposes, the following code correctly tells me that the source of the error was the process.nextTick(async () => {
try {
await new Promise((resolve, reject) => setTimeout(() => reject(new Error('Test error.')), 1));
} catch (e) {
console.error(e);
}
});
is |
This is really hard to work with, good lord. |
Node.js ate the trace where the promise was called as well. Same happens in Got, we can do nothing about it. The error is created in In the diff --git a/source/core/index.ts b/source/core/index.ts
index 084d0a3..22a0d81 100644
--- a/source/core/index.ts
+++ b/source/core/index.ts
@@ -2159,6 +2159,7 @@ export default class Request extends Duplex implements RequestEvents<Request> {
this.push(null);
});
+ console.log('core', new Error().stack);
this.emit('response', response);
for (const destination of this[kServerResponsesPiped]) { diff --git a/source/as-promise/index.ts b/source/as-promise/index.ts
index efd9470..34d6f54 100644
--- a/source/as-promise/index.ts
+++ b/source/as-promise/index.ts
@@ -125,6 +125,7 @@ export default function asPromise<T>(normalizedOptions: NormalizedOptions): Canc
}
if (!isResponseOk(response)) {
+ console.log('promise', new Error().stack);
request._beforeError(new HTTPError(response));
return;
}
|
Duplicate of #1077 |
Describe the bug
Actual behavior
It has no stacktrace, you know those that when you click takes you to the lines of code that led to that error
Expected behavior
It has stacktrace
Code to reproduce
Checklist
The text was updated successfully, but these errors were encountered: