mirror of
https://github.com/tenrok/axios.git
synced 2026-05-24 14:04:14 +03:00
17 lines
499 B
JavaScript
17 lines
499 B
JavaScript
'use strict';
|
|
|
|
var enhanceError = require('./enhanceError');
|
|
|
|
/**
|
|
* Create an Error with the specified message, config, and optional error code.
|
|
*
|
|
* @param {string} message The error message.
|
|
* @param {Object} config The config object.
|
|
* @param {string} [code] The error code (for example, 'ECONNABORTED').
|
|
* @returns {Error} The created error.
|
|
*/
|
|
module.exports = function createError(message, config, code) {
|
|
var error = new Error(message);
|
|
return enhanceError(error, config, code);
|
|
};
|