backend/controllers/AccessController.php
public function actionFault(){
$exception = Yii::$app->errorHandler->exception;
if ($exception !== null) {
$statusCode = $exception->statusCode;
$name = $exception->getName();
$message = $exception->getMessage();
$this->layout = 'layout';
return $this->render('error', [
'exception' => $exception,
'statusCode' => $statusCode,
'name' => $name,
'message' => $message
]);
}
backend/config/main.php
'components' => [
// ...
'errorHandler' => [
'errorAction' => 'access/fault',
],
// ...
],
If I am not wrong than actionError() will call when any error comes am i right ? But in my case actionError is not calling what i am doing wrong ?