MsieJavaScriptEngine.JsRt.JavaScriptContext.GetAndClearException C# (CSharp) Method

GetAndClearException() public static method

Returns the exception that caused the runtime of the current context to be in the exception state and resets the exception state for that runtime.

If the runtime of the current context is not in an exception state, this API will throw JsErrorInvalidArgument. If the runtime is disabled, this will return an exception indicating that the script was terminated, but it will not clear the exception (the exception will be cleared if the runtime is re-enabled using EnableRuntimeExecution).

Requires an active script context.

public static GetAndClearException ( ) : JavaScriptValue
return JavaScriptValue
        public static JavaScriptValue GetAndClearException()
        {
            JavaScriptValue reference;
            Native.ThrowIfError(Native.JsGetAndClearException(out reference));
            return reference;
        }