Add a Breakpoint
Add breakpoints when you get an exception in your code.
When you run your code and get an unhandled exception, you can click Create breakpoint in the Run window to add a breakpoint to your code. In the Breakpoints popup, set the desired configuration for your breakpoint and click Done. Debug your code using the shortcut ⌃D (macOS) / Shift+F9 (Windows/Linux). Code execution will stop at the breakpoint, and you can examine the state of your application in the Debug tool window.