We covered error (exceptions) handling in great detail back in Chapter 6, User Authorization and Access Control. We glossed over, however, the exceptions not related to HTTP status codes, and we just barely mentioned the way in which you can actually control how Yii handles errors.
The important point is that you will probably never need to change the way Yii handles errors, because it's really a well thought out algorithm covering all kinds of exceptional situations possible in a PHP application, so maybe you will never need to add anything to it.
The story about how Yii 2 handles errors is pretty simple. A Yii application has a special component attached by default, called the
\yii\base\ErrorHandler. To be precise, for ...