Hi,
i'm doing some unit tests in Silverlight. Therefore i'm invoking some javascript functions. i'd like to know how to get the message of the exception thrown in javascript. Is this possible?
Thanks! Peter
Hi,
i'm doing some unit tests in Silverlight. Therefore i'm invoking some javascript functions. i'd like to know how to get the message of the exception thrown in javascript. Is this possible?
Thanks! Peter
Here you go:
try {
foo();
} catch (e) {
alert("An exception occurred in the script. Error name: " + e.name
+ ". Error message: " + e.message); }
<Edit> Sorry, I just realized you need this in C# code. In order to do that, you'll have to take this data and pass it into your C# code somehow, whether by AJAX or form submission or something.