Last change
on this file since 6c1585f was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
414 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 |
|
---|
3 | var PACKAGE_NAME = require('../../package.json').name;
|
---|
4 |
|
---|
5 | /**
|
---|
6 | * Get an Error instance for the given message
|
---|
7 | * @param {...*} message Any number of message arguments
|
---|
8 | * @returns {Error}
|
---|
9 | */
|
---|
10 | function getError() {
|
---|
11 | var message = (PACKAGE_NAME + ':\n' + Array.prototype.slice.call(arguments).join(' '))
|
---|
12 | .split(/\s*\n\s*/)
|
---|
13 | .join('\n ');
|
---|
14 | return new Error(message);
|
---|
15 | }
|
---|
16 |
|
---|
17 | module.exports = getError; |
---|
Note:
See
TracBrowser
for help on using the repository browser.