Added throw-error utility.
This commit is contained in:
parent
6a01b622a2
commit
807b27048b
11
utils/throw-error.js
Normal file
11
utils/throw-error.js
Normal file
@ -0,0 +1,11 @@
|
||||
'use strict';
|
||||
|
||||
function throwError(message, params) {
|
||||
var error = new Error(message);
|
||||
for (var key in params) {
|
||||
error[key] = params[key];
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
|
||||
module.exports = throwError;
|
Loading…
Reference in New Issue
Block a user