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
cause
When trying to assign AxiosError.cause to unknown I get the following error, which does not happen with a normal Error class.
AxiosError.cause
unknown
Error
TS2739: Type {} is missing the following properties from type Error : name, message
Passing in ErrorOptions to a helper function we can recreate the issue. Currently I will need to add // @ts-ignore to get around this issue.
ErrorOptions
// @ts-ignore
export const setCauseError = ( error: AxiosError, options?: ErrorOptions ): Error => { if (options?.cause) { error.cause = options.cause } return error }
No TS error should be emitted to my IDE/type checking.
1.5.0
n/a
18.16.0
macOS 13.5.1
typescript 5.1.6
With Error:
With unknown:
The text was updated successfully, but these errors were encountered:
@jasonsaayman Are you or another member that maintains this package to take a look at the PR I've opened? #5850
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Describe the bug
When trying to assign
AxiosError.cause
tounknown
I get the following error, which does not happen with a normalError
class.To Reproduce
Passing in
ErrorOptions
to a helper function we can recreate the issue. Currently I will need to add// @ts-ignore
to get around this issue.Code snippet
Expected behavior
No TS error should be emitted to my IDE/type checking.
Axios Version
1.5.0
Adapter Version
n/a
Browser
n/a
Browser Version
n/a
Node.js Version
18.16.0
OS
macOS 13.5.1
Additional Library Versions
Additional context/Screenshots
With
Error
:With
unknown
:The text was updated successfully, but these errors were encountered: