mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-24 17:35:16 +00:00
17 lines
414 B
JavaScript
17 lines
414 B
JavaScript
'use strict';
|
|
|
|
var PACKAGE_NAME = require('../../package.json').name;
|
|
|
|
/**
|
|
* Get an Error instance for the given message
|
|
* @param {...*} message Any number of message arguments
|
|
* @returns {Error}
|
|
*/
|
|
function getError() {
|
|
var message = (PACKAGE_NAME + ':\n' + Array.prototype.slice.call(arguments).join(' '))
|
|
.split(/\s*\n\s*/)
|
|
.join('\n ');
|
|
return new Error(message);
|
|
}
|
|
|
|
module.exports = getError; |