BotanSS/errors/FatalError.js

20 lines
297 B
JavaScript

function error( msg )
{
this.name = "Fatal Error";
this.message = msg;
var e = new Error();
e = e.stack.split( "\n" );
e[0] = this.name;
e[1] = msg;
this.stack = e.join( "\n" );
}
error.prototype.toString = function()
{
return this.name + " " + this.message;
}
module.exports = error;