axios 0.25.0 → 0.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,43 +0,0 @@
1
- 'use strict';
2
-
3
- /**
4
- * Update an Error with the specified config, error code, and response.
5
- *
6
- * @param {Error} error The error to update.
7
- * @param {Object} config The config.
8
- * @param {string} [code] The error code (for example, 'ECONNABORTED').
9
- * @param {Object} [request] The request.
10
- * @param {Object} [response] The response.
11
- * @returns {Error} The error.
12
- */
13
- module.exports = function enhanceError(error, config, code, request, response) {
14
- error.config = config;
15
- if (code) {
16
- error.code = code;
17
- }
18
-
19
- error.request = request;
20
- error.response = response;
21
- error.isAxiosError = true;
22
-
23
- error.toJSON = function toJSON() {
24
- return {
25
- // Standard
26
- message: this.message,
27
- name: this.name,
28
- // Microsoft
29
- description: this.description,
30
- number: this.number,
31
- // Mozilla
32
- fileName: this.fileName,
33
- lineNumber: this.lineNumber,
34
- columnNumber: this.columnNumber,
35
- stack: this.stack,
36
- // Axios
37
- config: this.config,
38
- code: this.code,
39
- status: this.response && this.response.status ? this.response.status : null
40
- };
41
- };
42
- return error;
43
- };