You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
414 B

4 years ago
  1. 'use strict';
  2. var PACKAGE_NAME = require('../../package.json').name;
  3. /**
  4. * Get an Error instance for the given message
  5. * @param {...*} message Any number of message arguments
  6. * @returns {Error}
  7. */
  8. function getError() {
  9. var message = (PACKAGE_NAME + ':\n' + Array.prototype.slice.call(arguments).join(' '))
  10. .split(/\s*\n\s*/)
  11. .join('\n ');
  12. return new Error(message);
  13. }
  14. module.exports = getError;