bug fixes.

This commit is contained in:
Qiang Xue
2013-03-25 19:37:42 -04:00
parent 379e48a4c6
commit 80dbaaca8b
4 changed files with 14 additions and 5 deletions

View File

@@ -479,6 +479,9 @@ class Application extends Module
$msg = (string)$e;
$msg .= "\nPrevious exception:\n";
$msg .= (string)$exception;
if (YII_DEBUG) {
echo $msg;
}
$msg .= "\n\$_SERVER = " . var_export($_SERVER, true);
error_log($msg);
exit(1);

View File

@@ -78,7 +78,7 @@ class ErrorHandler extends Component
if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] === 'XMLHttpRequest') {
\Yii::$app->renderException($exception);
} else {
$view = new View($this);
$view = new View;
if (!YII_DEBUG || $exception instanceof UserException) {
$viewName = $this->errorView;
} else {
@@ -86,7 +86,7 @@ class ErrorHandler extends Component
}
echo $view->render($viewName, array(
'exception' => $exception,
));
), $this);
}
} else {
\Yii::$app->renderException($exception);
@@ -255,8 +255,8 @@ class ErrorHandler extends Component
{
$view = new View;
$name = !YII_DEBUG || $exception instanceof HttpException ? $this->errorView : $this->exceptionView;
echo $view->render($this, $name, array(
echo $view->render($name, array(
'exception' => $exception,
));
), $this);
}
}