Skip to content

fix: status is missing in AxiosError on and after v1.13.3#7368

Merged
jasonsaayman merged 5 commits intoaxios:v1.xfrom
WillianAgostini:fix/7364
Feb 4, 2026
Merged

fix: status is missing in AxiosError on and after v1.13.3#7368
jasonsaayman merged 5 commits intoaxios:v1.xfrom
WillianAgostini:fix/7364

Conversation

@WillianAgostini
Copy link
Contributor

@WillianAgostini WillianAgostini commented Feb 3, 2026

Fixes #7364

Included request and response in AxiosError when using the fetch adapter.


Summary by cubic

Fixes missing status in AxiosError when using the fetch adapter. Failed requests now include error.status.

  • Bug Fixes
    • Pass request and response to AxiosError in the fetch adapter so status is populated.
    • Add tests for fetch and http adapters to verify error.status is present on 400 responses.

Written for commit be90c25. Summary will update on new commits.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 2 files

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="lib/adapters/fetch.js">

<violation number="1" location="lib/adapters/fetch.js:250">
P2: Using `err.request` causes the `request` object to be lost in the `AxiosError` for network errors, as the native `TypeError` does not contain it. Restore using the local `request` variable.</violation>

<violation number="2" location="lib/adapters/fetch.js:257">
P2: If `err.request` is missing (e.g. for non-Axios errors), the error should fallback to using the local `request` variable to preserve context.</violation>
</file>

Since this is your first cubic review, here's how it works:

  • cubic automatically reviews your code and comments on bugs and improvements
  • Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
  • Ask questions if you need clarification on any suggestion

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

WillianAgostini and others added 3 commits February 3, 2026 20:36
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Copy link
Member

@jasonsaayman jasonsaayman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@jasonsaayman jasonsaayman merged commit 696fa75 into axios:v1.x Feb 4, 2026
7 checks passed
This was referenced Feb 8, 2026
This was referenced Feb 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

status is missing in AxiosError on and after v1.13.3

2 participants