|
|
@ -81,7 +81,10 @@ class ErrorHandler extends Component |
|
|
|
if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] === 'XMLHttpRequest') { |
|
|
|
if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] === 'XMLHttpRequest') { |
|
|
|
\Yii::$app->renderException($exception); |
|
|
|
\Yii::$app->renderException($exception); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
try { |
|
|
|
if(YII_DEBUG) { |
|
|
|
|
|
|
|
ini_set('display_errors', 1); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$view = new View; |
|
|
|
$view = new View; |
|
|
|
if (!YII_DEBUG || $exception instanceof UserException) { |
|
|
|
if (!YII_DEBUG || $exception instanceof UserException) { |
|
|
|
$viewName = $this->errorView; |
|
|
|
$viewName = $this->errorView; |
|
|
@ -91,9 +94,9 @@ class ErrorHandler extends Component |
|
|
|
echo $view->renderFile($viewName, array( |
|
|
|
echo $view->renderFile($viewName, array( |
|
|
|
'exception' => $exception, |
|
|
|
'exception' => $exception, |
|
|
|
), $this); |
|
|
|
), $this); |
|
|
|
} |
|
|
|
|
|
|
|
catch (\Exception $e) { |
|
|
|
if(YII_DEBUG) { |
|
|
|
\Yii::$app->renderException($e); |
|
|
|
ini_set('display_errors', 0); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|