2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-17 19:21:29 +03:00
Files
axios/tests/unit
AKIBUZZAMAN AKIB e04ee42a67 fix(AxiosError): document and test error.status behaviour (#10725)
error.status is set to response.status when a response is available,
and is undefined for network-level errors that have no HTTP response.

Add an inline comment in the constructor clarifying this contract, and
add four regression tests for issue #5330 covering:
- 4xx errors (error.status === response.status)
- 5xx errors
- network errors (error.status is undefined)
- toJSON includes the status field

Fixes #5330

Co-authored-by: AKIBUZZAMAN AKIB <akibuzzamanakib473@gmail.com>
Co-authored-by: Jay <jasonsaayman@gmail.com>
2026-04-15 20:45:58 +02:00
..