-
Notifications
You must be signed in to change notification settings - Fork 18
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
Swallowing errors with Axios #56
Comments
Doing the following in my entry script does seem to fix the issue: global.Error = class extends Error {
constructor(message) {
super(message);
this.stack += '';
}
} |
Sounds like you didn't set the Error.stackTraceLimit. |
Thanks for the response @AndreasMadsen. I have tried the code below: require('trace');
require('clarify');
Error.stackTraceLimit = 100000;
const axios = require('axios')
async function main () {
await axios(`https://example.com/xxxxxxxx`)
}
main() Which outputs the same "error":
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm trying to use Axios to make http calls and have the following code.
It of course fails with a 404 as expected with absolutely no useful information.
So let's put in
trace
.This still doesn't give us anything useful.
So I looked into the Axios codebase to see what is going on and discovered they have a
createError
function. I edited the following...Note the only thing I changed was effectively running the setter for stack.
error.stack += '';
Again I get nothing. BUT when I install
clarify
I finally get the information I wanted:I need both
clarify
and to touch the.stack
inside Axios to make this work.I don't mind having to keep clarify installed, that's all good and I'd be using it anyway. But obviously touching Axios or any other libraries to touch the
.stack
seems weird.Am I crazy? Is this a bug and known? Is there anything I can do?
Thanks and amazing projects btw.
The text was updated successfully, but these errors were encountered: