This commit is contained in:
eason 2026-04-09 16:02:30 -07:00 committed by GitHub
commit f372f07ec5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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