-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Add a script debugger "break on error" #2830
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'd love to wire such a feature up to Visual Studio Code's exception breakpoints. |
Consider exposing this as |
Seems like you could install an unhandled exception filter to catch the exception during the first pass - in which case, process state should still be known. I particularly like this old Matt Pietrek article on the subject - https://www.microsoft.com/msj/0197/Exception/Exception.aspx |
@SteveL-MSFT Agreed. |
Thanks to @lzybkr for pointing this out. |
@SteveL-MSFT alternative:
|
EDIT: Moving my comments and vscode workaround to PowerShell/vscode-powershell#298 |
This has been implemented by Kirk as an experimental feature. |
It would be good to have the ability to drop into the script debugger on error. This is relatively easy for non-terminating errors since the PowerShell engine continues to run and so the debugger runs. But exceptions are trickier since the process state is unknown. For exceptions thrown by PowerShell (ErrorAction: "Stop") we could stop in the debugger before throwing the exception. It might be possible to have an unhandled exception handler to allow inspection of the runspace on a thrown exception.
The text was updated successfully, but these errors were encountered: