You can specify if the debugger breaks on the next error. If the debugger is set to break on errors, then it breaks execution both on errors that are handled in code and on unhandled errors. By default, the debugger is set to break on errors.
When the debugger breaks on an error, you can inspect variables and parameters. You can also review the error message in the Debugger window, on the Home tab, in the Show group, by choosing Last Error.
For more information about how to open the Debugger window, see Activating the Debugger.
To break on errors
Activate the debugger. For more information, see How to: Activate the Debugger from the Development Environment or How to: Activate the Debugger at the Command Prompt.
In the Debugger window, on the Home tab, in the Breakpoints group, choose Break Rules.
In the Debugger Break Rules window, select the Break On Error check box, and then choose the OK button.