Quantcast
Channel: ClearScript
Viewing all articles
Browse latest Browse all 2297

New Post: Handling CLR exceptions in JS

0
0
Hi,

I'm using the V8ScriptEngine and am wondering how to handle CLR exceptions.

Right now, the object I use with AddHostObject may throw some exceptions but I haven't found a way to properly handle them. Wrapping the call (in JS) with a try/catch block didn't really help as the CLR exception remains unhandled, and what I seem to catch in JS is a TargetInvocationException, not the exception actually thrown by the CLR object (which, I guess, is down the InnerException stack).

Is there some best practice here?
Thanks in advance,
Thomas

Viewing all articles
Browse latest Browse all 2297