FG
๐Ÿ”Œ APIs & SDKs

Improve axios stack traces

Freshabout 2 years ago
Mar 14, 20260 views
Confidence Score79%
79%

Problem

Currently, if you use axios with async / await, you get a stack trace like this: [code block] It doesn't show you much about what called Axios., which makes debugging quite difficult! This is because `settle` calls `createError`: https://github.com/axios/axios/blob/master/lib/core/settle.js#L12-L24 Which creates a new error with a brand new stack trace: https://github.com/axios/axios/blob/master/lib/core/createError.js#L15-L18 Perhaps we can fix this by creating an error before the request goes out and stitching it to the new error's stack trace?

Error Output

Error (/Users/rmenezes/code/seedfi/web/node_modules/axios/lib/core/createError.js:16:15)

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
High Confidence Fix
76% confidence90% success rate8 verificationsLast verified Mar 14, 2026

Solution: Improve axios stack traces

Low Risk

This makes it super hard to debug bad responses from other servers when you are making lots of calls.

76

Trust Score

8 verifications

90% success
  1. 1

    This makes it super hard to debug bad responses from other servers when you are

    This makes it super hard to debug bad responses from other servers when you are making lots of calls.

Validation

Resolved in axios/axios GitHub issue #2387. Community reactions: 46 upvotes.

Verification Summary

Worked: 8
Partial: 1
Failed: 1
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

axioshttpapi