mirror of
https://github.com/CharaChorder/DeviceManager.git
synced 2026-01-20 00:43:04 +00:00
18 lines
361 B
JavaScript
18 lines
361 B
JavaScript
'use strict';
|
|
|
|
/** @typedef {Error & { code: number }} ConfigurationError */
|
|
|
|
/**
|
|
* Create configurationError from text and set CLI exit code.
|
|
*
|
|
* @param {string} text
|
|
* @returns {ConfigurationError}
|
|
*/
|
|
module.exports = function configurationError(text) {
|
|
const err = /** @type {ConfigurationError} */ (new Error(text));
|
|
|
|
err.code = 78;
|
|
|
|
return err;
|
|
};
|