From 94ddfd1c69253d128fbdc78d1915dda545d3387d Mon Sep 17 00:00:00 2001 From: xue <> Date: Fri, 18 Nov 2005 22:07:11 +0000 Subject: --- framework/Exceptions/TErrorHandler.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'framework/Exceptions') 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(); -- cgit v1.2.3