aboutsummaryrefslogtreecommitdiff
path: root/node_modules/axios/lib/core/enhanceError.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/axios/lib/core/enhanceError.js')
-rw-r--r--node_modules/axios/lib/core/enhanceError.js43
1 files changed, 0 insertions, 43 deletions
diff --git a/node_modules/axios/lib/core/enhanceError.js b/node_modules/axios/lib/core/enhanceError.js
deleted file mode 100644
index db04ec8..0000000
--- a/node_modules/axios/lib/core/enhanceError.js
+++ /dev/null
@@ -1,43 +0,0 @@
-'use strict';
-
-/**
- * Update an Error with the specified config, error code, and response.
- *
- * @param {Error} error The error to update.
- * @param {Object} config The config.
- * @param {string} [code] The error code (for example, 'ECONNABORTED').
- * @param {Object} [request] The request.
- * @param {Object} [response] The response.
- * @returns {Error} The error.
- */
-module.exports = function enhanceError(error, config, code, request, response) {
- error.config = config;
- if (code) {
- error.code = code;
- }
-
- error.request = request;
- error.response = response;
- error.isAxiosError = true;
-
- error.toJSON = function 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: this.config,
- code: this.code,
- status: this.response && this.response.status ? this.response.status : null
- };
- };
- return error;
-};