replaced all stop callbacks with customError callbacks. Fixes #270

This commit is contained in:
Peter 'Pita' Martischka 2011-12-10 16:46:47 +01:00
parent 22fd5ae33d
commit 6684d6ed52
7 changed files with 59 additions and 38 deletions

17
node/utils/customError.js Normal file
View file

@ -0,0 +1,17 @@
/*
This helper modules allows us to create different type of errors we can throw
*/
function customError(message, errorName)
{
this.name = errorName || "Error";
this.message = message;
var stackParts = new Error().stack.split("\n");
stackParts.splice(0,2);
stackParts.unshift(this.name + ": " + message);
this.stack = stackParts.join("\n");
}
customError.prototype = Error.prototype;
module.exports = customError;