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

New Post: Handling CLR exceptions in JS

$
0
0
I see there was mention of a more general version of this but I don't know where to look for follow-up.

Is there some sort of interface or magic return type we can use to signal the result of an invocation should be turned into a hosted script exception?

e.g. public void MyCLRMethod() {
if (errorCondition) {
  return new ITurnIntoaScriptingExceptionType('Oops you did something wrong');
}
}

script:
try {
 o.MyClrMethod();
}
catch(x) {
 // yay I was handled?
}

I need a way to raise errors in the .NET world that can be handled by the script (V8).

Viewing all articles
Browse latest Browse all 2297

Latest Images

Trending Articles





Latest Images