use yii\web\ForbiddenHttpException;
...
public function actionError()
{
if (($exception = Yii::$app->getErrorHandler()->exception) === null) {
return '';
}
if($exception instanceof ForbiddenHttpException){
return 'Oops, access forbidden: '.$exception->getMessage();
}
}