mirror of
https://github.com/axios/axios.git
synced 2026-04-12 02:31:57 +08:00
Merge 05d15386a7 into c7a76ddbf2
This commit is contained in:
commit
f372f07ec5
@ -5,7 +5,7 @@ import utils from '../utils.js';
|
||||
class AxiosError extends Error {
|
||||
static from(error, code, config, request, response, customProps) {
|
||||
const axiosError = new AxiosError(error.message, code || error.code, config, request, response);
|
||||
axiosError.cause = error;
|
||||
Object.defineProperty(axiosError, 'cause', {value: error, configurable: true, writable: true});
|
||||
axiosError.name = error.name;
|
||||
|
||||
// Preserve status from the original error if not already set from response
|
||||
|
||||
Loading…
Reference in New Issue
Block a user