This commit is contained in:
Ilya Kantor 2017-04-17 21:42:33 +02:00
parent 8fc01fa0fe
commit a4a16fccd6
8 changed files with 105 additions and 26 deletions

View file

@ -47,13 +47,13 @@ class ValidationError extends Error {
}
function test() {
throw new ValidationError("Woops!");
throw new ValidationError("Whoops!");
}
try {
test();
} catch(err) {
alert(err.message); // Woops!
alert(err.message); // Whoops!
alert(err.name); // ValidationError
alert(err.stack); // a list of nested calls with line numbers for each
}