/// <summary> /// This event occurs when a terminating execption is thrown from the /// PowerShell debugger. /// </summary> /// <remarks> /// This event triggers a Visual Studio Excecption event so that /// Visual Studio displays the exception window accordingly. /// </remarks> /// <param name="sender"></param> /// <param name="e"></param> void Debugger_TerminatingException(object sender, EventArgs <PowerShellRunTerminatingException> e) { if (e.Value.Error != null && e.Value.Error.InvocationInfo != null) { var scriptLocation = new ScriptLocation(e.Value.Error.InvocationInfo.ScriptName, e.Value.Error.InvocationInfo.ScriptLineNumber, 0); //_events.Break(_node); } _events.Exception(_node, new Exception(e.Value.Message)); }
/// <summary> /// This event occurs when a terminating execption is thrown from the /// PowerShell debugger. /// </summary> /// <remarks> /// This event triggers a Visual Studio Excecption event so that /// Visual Studio displays the exception window accordingly. /// </remarks> /// <param name="sender"></param> /// <param name="e"></param> void Debugger_TerminatingException(object sender, EventArgs <Exception> e) { if (e.Value is RuntimeException) { var re = e.Value as RuntimeException; var scriptLocation = new ScriptLocation(); scriptLocation.Column = 0; scriptLocation.File = re.ErrorRecord.InvocationInfo.ScriptName; scriptLocation.Line = re.ErrorRecord.InvocationInfo.ScriptLineNumber; //_events.Break(_node); } _events.Exception(_node, e.Value); }