PHP 8.2.30
Preview: AxiosError.js Size: 2.45 KB
/home/byroehnu/easepay.easetack.com/node_modules/axios/lib/core/AxiosError.js

'use strict';

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;
        axiosError.name = error.name;
        customProps && Object.assign(axiosError, customProps);
        return axiosError;
    }

    /**
     * Create an Error with the specified message, config, error code, request and response.
     *
     * @param {string} message The error message.
     * @param {string} [code] The error code (for example, 'ECONNABORTED').
     * @param {Object} [config] The config.
     * @param {Object} [request] The request.
     * @param {Object} [response] The response.
     *
     * @returns {Error} The created error.
     */
    constructor(message, code, config, request, response) {
        super(message);
        this.name = 'AxiosError';
        this.isAxiosError = true;
        code && (this.code = code);
        config && (this.config = config);
        request && (this.request = request);
        if (response) {
            this.response = response;
            this.status = response.status;
        }
    }

    toJSON() {
        return {
            // Standard
            message: this.message,
            name: this.name,
            // Microsoft
            description: this.description,
            number: this.number,
            // Mozilla
            fileName: this.fileName,
            lineNumber: this.lineNumber,
            columnNumber: this.columnNumber,
            stack: this.stack,
            // Axios
            config: utils.toJSONObject(this.config),
            code: this.code,
            status: this.status,
        };
    }
}

// This can be changed to static properties as soon as the parser options in .eslint.cjs are updated.
AxiosError.ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE';
AxiosError.ERR_BAD_OPTION = 'ERR_BAD_OPTION';
AxiosError.ECONNABORTED = 'ECONNABORTED';
AxiosError.ETIMEDOUT = 'ETIMEDOUT';
AxiosError.ERR_NETWORK = 'ERR_NETWORK';
AxiosError.ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS';
AxiosError.ERR_DEPRECATED = 'ERR_DEPRECATED';
AxiosError.ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE';
AxiosError.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST';
AxiosError.ERR_CANCELED = 'ERR_CANCELED';
AxiosError.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';
AxiosError.ERR_INVALID_URL = 'ERR_INVALID_URL';

export default AxiosError;

Directory Contents

Dirs: 0 × Files: 11

Name Size Perms Modified Actions
127 B lr--r--r-- 2026-03-14 01:49:09
Edit Download
7.15 KB lrw-r--r-- 2026-02-20 03:53:00
Edit Download
2.45 KB lrw-r--r-- 2026-02-20 03:53:04
Edit Download
7.22 KB lrw-r--r-- 2026-02-20 03:53:04
Edit Download
783 B lrw-r--r-- 2026-02-20 03:53:06
Edit Download
2.14 KB lrw-r--r-- 2026-02-20 03:53:06
Edit Download
1.56 KB lrw-r--r-- 2026-02-20 03:53:06
Edit Download
3.49 KB lrw-r--r-- 2026-02-20 03:53:08
Edit Download
399 B lrw-r--r-- 2026-02-20 03:53:18
Edit Download
836 B lrw-r--r-- 2026-02-20 03:53:08
Edit Download
776 B lrw-r--r-- 2026-02-20 03:53:10
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).