123456789101112131415161718192021222324252627282930313233343536373839404142 |
- 'use strict';
- 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 {
-
- message: this.message,
- name: this.name,
-
- description: this.description,
- number: this.number,
-
- fileName: this.fileName,
- lineNumber: this.lineNumber,
- columnNumber: this.columnNumber,
- stack: this.stack,
-
- config: this.config,
- code: this.code
- };
- };
- return error;
- };
|