Fixed incorrect error handling.

This commit is contained in:
Qiang Xue
2014-03-02 12:32:22 -05:00
parent f22d409e8b
commit 7b46dc3443

View File

@ -93,10 +93,10 @@ class ErrorHandler extends Component
return;
}
$useErrorView = $response->format === \yii\web\Response::FORMAT_HTML && (!YII_DEBUG || $exception instanceof UserException);
$response = Yii::$app->getResponse();
$useErrorView = $response->format === \yii\web\Response::FORMAT_HTML && (!YII_DEBUG || $exception instanceof UserException);
if ($useErrorView && $this->errorAction !== null) {
$result = Yii::$app->runAction($this->errorAction);
if ($result instanceof Response) {