diff options
author | xue <> | 2005-11-18 22:07:11 +0000 |
---|---|---|
committer | xue <> | 2005-11-18 22:07:11 +0000 |
commit | 94ddfd1c69253d128fbdc78d1915dda545d3387d (patch) | |
tree | 9dc1e2f10e6b1fd74ac29d56060ad5c98a23856a /framework/Exceptions | |
parent | 6b647694bdae2ab37246447cb965a5e7f97290ed (diff) |
Diffstat (limited to 'framework/Exceptions')
-rw-r--r-- | framework/Exceptions/TErrorHandler.php | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/framework/Exceptions/TErrorHandler.php b/framework/Exceptions/TErrorHandler.php index 687351d5..29daad74 100644 --- a/framework/Exceptions/TErrorHandler.php +++ b/framework/Exceptions/TErrorHandler.php @@ -27,7 +27,12 @@ class TErrorHandler extends TComponent implements IModule $application->attachEventHandler('Error',array($this,'handleError'));
$application->setErrorHandler($this);
foreach($config->getElementsByTagName('error') as $node)
- $this->_errorPages[$node->getAttribute('code')]=$node->getAttribute('page');
+ {
+ if(($code=$node->getAttribute('code'))===null || $code==='*')
+ $code=0;
+ else
+ $this->_errorPages[$node->getAttribute('code')]=$node->getAttribute('page');
+ }
}
/**
@@ -70,9 +75,12 @@ class TErrorHandler extends TComponent implements IModule {
if(!($exception instanceof THttpException))
error_log($exception->__toString());
- if(isset($this->_errorPages["$statusCode"]))
+ if(isset($this->_errorPages["$statusCode"]) || isset($this->_errorPages[0]))
{
- $page=Prado::createComponent($this->_errorPages["$statusCode"]);
+ if(isset($this->_errorPages["$statusCode"]))
+ $page=Prado::createComponent($this->_errorPages["$statusCode"]);
+ else
+ $page=Prado::createComponent($this->_errorPages[0]);
$writer=new THtmlTextWriter($this->_application->getResponse());
$page->run($writer);
$writer->flush();
|