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

New Post: Exception propagation from C# to Javascript

0
0
Hi again,

When you use V8, ClearScript marshals host exceptions to script code. In the above, the host exception should be accessible via err.hostException. Note that this is likely to be an instance of TargetInvocationException, so you might want to use err.hostException.GetBaseException() to access the "root" exception (see here).

Another possibility (and one that works with all script engines) is to use ClearScript's HostFunctions.tryCatch.

Good luck!

Viewing all articles
Browse latest Browse all 2297