Can someone explain why when I simply do this:
try {
throw new Error("Big Mistake!!!");
catch(e) {
e.getMessage();
}
(…) The error object is not passed to the catch block. The “e” is undefined, thus not possible to read the message.
I was just trying to follow one of the tutorials…
Thank you.
Hi,
This one works :
try
{
throw new Error("Big Mistake!!!");
}
catch(e)
{
application.output(e.name);
application.output(e.message);
}
and this one
try
{
var bigerr = new Error();
bigerr.name = 'My Big Error';
bigerr.message = 'Big Mistake !';
throw(bigerr);
}
catch(e)
{
application.output(e.name);
application.output(e.message);
}
This is standard Javascript
Regards,
Hans