Custom Exception Hierarchy Best Practices
When a software engineer designs and implements an application, they try to think of anything that could go wrong and handle it appropriately. The programming language they use offers special tools and constructs to help the developers achieve this goal.
In object oriented programming, an exception is being used to model an error that occurs at runtime. When things don't go as expected or assumptions are not valid, then a piece of code might decide to raise an exception. The exception raised notifies the caller about the error and lets it handle it. The caller might decide to not handle the error. In that case, the error is bubbled up to the next higher caller in the stack. This continues until the error reaches the top level of the call stack. At that level, if the error is not handled, then the program usually stops and reports the error to the operating system.Built-In Exception Classes
Feb 18, 2021