I’m working on Yii2 advanced application project and I have a problem with yii2 built-in Error Handler. Here is description of my problem:
I have set errorAction in my backend configuration in this way:
'errorHandler' => [
'errorAction' => 'site/error',
],
Now, the method actionError() in the SiteController catches every application exceptions, user defined exceptions and also fatal errors, except database related exception such as yii\db\IntegrityException. I don’t know why, but when such an exception occurs, actionError() does not do anything! I don’t want to catch exception manually with try-catch block and I want the central ErrorHandler catches all exception.
How can I fix this problem? Thank you all specially yii experts for paying attention. Please help me to solve this strange problem.