mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 15:36:16 -04:00
The Big Renaming - etherpad is now an NPM module
This commit is contained in:
parent
1955bdec9a
commit
1239ce7f28
116 changed files with 9721 additions and 30 deletions
17
src/node/utils/customError.js
Normal file
17
src/node/utils/customError.js
Normal 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;
|
Loading…
Add table
Add a link
Reference in a new issue