The SPL provides a number of built-in exception base classes that are designed to handle everyday scenarios. In this chapter, you will learn about the base exception classes, when to apply them, and how to extend them for your own requirements.
The SPL has two central classes of exceptions:
RuntimeException (discussed in the next section). The
LogicException class descends from
Exception directly, and does not add any additional methods.
class LogicException extends Exception
The purpose of this classification is to allow you to differentiate between compile-time logical exceptions and exceptions caused by bad data being passed to the application.
Invoking a logic exception is just ...