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

Commented Feature: Throw specific script exception by host [43]

$
0
0
Hi,

Would it be possible to add a custom exception, so that when it is thrown by host it throws a script exception of the specified type and message.

For example, in host code:

```
throw new CustomScriptException("RangeError", "custom message");
```

will cause script to execute:

```
throw new RangeError('custom message');
```

Specifically, for the example above I need the exception to be instanceof RangeError.

Thanks again in advance,
Ron


Comments: I have tried this method, however I can only seem to get generic ScriptEngineExceptions with the message set to "Exception has been thrown by the target of an invocation". Any ideas how I could get the original exception from the tryCatch exception handler?

Viewing all articles
Browse latest Browse all 2297

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>