configurationError.js 361 B

1234567891011121314151617
  1. 'use strict';
  2. /** @typedef {Error & { code: number }} ConfigurationError */
  3. /**
  4. * Create configurationError from text and set CLI exit code.
  5. *
  6. * @param {string} text
  7. * @returns {ConfigurationError}
  8. */
  9. module.exports = function configurationError(text) {
  10. const err = /** @type {ConfigurationError} */ (new Error(text));
  11. err.code = 78;
  12. return err;
  13. };