I'm trying to create a custom exception with some useful debug information:
var customError = function(name, message) {
this.message = message;
this.name = name;
this.prototype = new Error(); // to make customError "inherit" from the
// default error
};
throw new customError('CustomException', 'Something went wrong');
But all I'm getting are fuzzy messages in the console:
IE: "SCRIPT5022: Exception thrown and not caught "
Firefox: "uncaught exception: [object Object]"
What do I need to change in order to get something useful out of my exceptions?