Fixes #3183: fixed regression after #3175

This commit is contained in:
Alexander Makarov
2014-04-30 01:30:49 +04:00
parent 468e4191e0
commit 340278b59c
4 changed files with 33 additions and 13 deletions

View File

@@ -379,4 +379,17 @@ class ErrorHandler extends \yii\base\ErrorHandler
return $out;
}
/**
* Returns human-readable exception name
* @param \Exception $exception
* @return string human-readable exception name or null if it cannot be determined
*/
public function getExceptionName($exception)
{
if ($exception instanceof \yii\base\Exception || $exception instanceof \yii\base\InvalidCallException || $exception instanceof \yii\base\InvalidParamException || $exception instanceof \yii\base\UnknownMethodException) {
return $exception->getName();
}
return null;
}
}