We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch axios-better-stacktrace@2.0.2 for the project I'm working on.
axios-better-stacktrace@2.0.2
Inside a typescript project the net.js library don't always throw error as instances or errors. The instanceof keyword can failed during the check.
net.js
Here is the diff that solved my problem:
diff --git a/node_modules/axios-better-stacktrace/lib/axiosBetterStacktrace.js b/node_modules/axios-better-stacktrace/lib/axiosBetterStacktrace.js index f16af8e..91678fd 100644 --- a/node_modules/axios-better-stacktrace/lib/axiosBetterStacktrace.js +++ b/node_modules/axios-better-stacktrace/lib/axiosBetterStacktrace.js @@ -12,8 +12,11 @@ var __assign = (this && this.__assign) || function () { }; Object.defineProperty(exports, "__esModule", { value: true }); var patchedSym = Symbol('axiosBetterStacktrace.patched'); +var isError = function (error) { + return Object.prototype.toString.call(error) === "[object Error]"; +} var isAxiosError = function (error) { - return error instanceof Error && error.isAxiosError; + return (error instanceof Error || isError(error)) && error.isAxiosError; }; var axiosMethods = [ 'request',
This issue body was partially generated by patch-package.
The text was updated successfully, but these errors were encountered:
Hi, I'd appreciate repro steps along with the patch, I assume you use different vmcontexts that break instanceof operator?
Sorry, something went wrong.
fix: Improve error type detection (#5)
e955d9b
Fixed in v2.1.1.
No branches or pull requests
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch
axios-better-stacktrace@2.0.2
for the project I'm working on.Inside a typescript project the
net.js
library don't always throw error as instances or errors.The instanceof keyword can failed during the check.
Here is the diff that solved my problem:
This issue body was partially generated by patch-package.
The text was updated successfully, but these errors were encountered: