diff options
author | jrags <> | 2007-02-21 16:31:50 +0000 |
---|---|---|
committer | jrags <> | 2007-02-21 16:31:50 +0000 |
commit | 0da331cb45cf202bf7fbd519c8d65f5956c85b2b (patch) | |
tree | 7c73d6f7e0ae58a053720a6c0ff35ace2acb6c40 /demos/activeblog/protected/App_Modules/BlogErrorHandler.php | |
parent | a2555e2441f51147e9e773f38624021067744d21 (diff) |
Converted BlogDataModule Record classes to use active record, also changed the data module to load the database into the active record handler
Diffstat (limited to 'demos/activeblog/protected/App_Modules/BlogErrorHandler.php')
-rw-r--r-- | demos/activeblog/protected/App_Modules/BlogErrorHandler.php | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/demos/activeblog/protected/App_Modules/BlogErrorHandler.php b/demos/activeblog/protected/App_Modules/BlogErrorHandler.php new file mode 100644 index 00000000..dc8985d8 --- /dev/null +++ b/demos/activeblog/protected/App_Modules/BlogErrorHandler.php @@ -0,0 +1,46 @@ +<?php
+/**
+ * BlogErrorHandler class file
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright © 2006 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @version $Id: BlogErrorHandler.php 1509 2006-11-25 20:51:43Z xue $
+ */
+
+Prado::using('System.Exceptions.TErrorHandler');
+Prado::using('Application.Common.BlogException');
+
+/**
+ * BlogErrorHandler class
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright © 2006 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ */
+class BlogErrorHandler extends TErrorHandler
+{
+ /**
+ * Displays error to the client user.
+ * THttpException and errors happened when the application is in <b>Debug</b>
+ * mode will be displayed to the client user.
+ * @param integer response status code
+ * @param Exception exception instance
+ */
+ protected function handleExternalError($statusCode,$exception)
+ {
+ if($exception instanceof BlogException)
+ {
+ $message=$exception->getMessage();
+ Prado::log($message,TLogger::ERROR,'BlogApplication');
+ $message=urldecode($this->getApplication()->getSecurityManager()->hashData($message));
+ $this->Response->redirect($this->Service->constructUrl('ErrorReport',array('msg'=>$message),false));
+ }
+ else
+ parent::handleExternalError($statusCode,$exception);
+ }
+}
+
+?>
\ No newline at end of file |