Summary

Completed

Your goal was to gain experience with the Visual Studio Code debugger, implement a try-catch pattern, and create and throw exceptions that are caught at a lower level of the call stack.

By reviewing the cash register application, debugging the MakeChange method, and implementing exception handling techniques in both the method and calling code, you gained the experience you wanted. You used the debugger tools to configure a breakpoint in the top-level statements of the application. With execution paused, you stepped through the code to isolate an issue in the code logic. You implemented a try-catch pattern in the top-level statements, created and threw an InvalidOperationException exception in the MakeChange method, and then updated the catch clause to catch only the InvalidOperationException exception type.

The ability to debug C# applications and implement exception handling enables you to develop stable and reliable applications.

Get a free verified certification

Microsoft and freeCodeCamp.org offer a training and certification combo on foundational C#. By completing this Learn module, you've already started. Explore freeCodeCamp's Foundational C# with Microsoft certification here: https://aka.ms/csharp-certification.