Summary

Completed

Your goal was to gain experience creating and throwing customized exception objects that can be caught and handled within a catch code block.

By creating, throwing, catching, and handling customized exceptions, you simplify the process for exposing and correcting programmatic issues within your application. Customizing exceptions with information specific to your application enables you to optimize the explanation of issues within the application's user interface. Throwing exceptions within a method and using C#'s built in support for catching exception objects at any level within the call stack helps to ensure that issues are caught where they can be handled.

Without the ability to create and throw customized exception objects, your code would be more difficult to maintain and the user experience would suffer.

Reference materials

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.