Added a handler for fatal errors, showing internal server error page when debug is disabled or a custom fatal error page when enabled.

This commit is contained in:
Juan Basso 2012-03-29 00:20:17 -04:00
parent f677bfea7d
commit 440f0c38eb
5 changed files with 105 additions and 1 deletions

View file

@ -517,3 +517,30 @@ class XmlException extends CakeException {
*/
class ConsoleException extends CakeException {
}
/**
* Represents a fatal error
*
* @package Cake.Error
*/
class FatalErrorException extends CakeException {
/**
* Constructor
*
* @param string $message
* @param integer $code
* @param string $file
* @param integer $line
*/
public function __construct($message, $code = 500, $file = null, $line = null) {
parent::__construct($message, $code);
if ($file) {
$this->file = $file;
}
if ($line) {
$this->line = $line;
}
}
}