diff options
author | ctrlaltca <> | 2012-07-12 11:21:01 +0000 |
---|---|---|
committer | ctrlaltca <> | 2012-07-12 11:21:01 +0000 |
commit | 903ae8a581fac1e6917fc3e31d2ad8fb91df80c3 (patch) | |
tree | e08bf04f0823650a231227ac3499121270172a23 /demos/blog-tutorial/samples/day5/blog/protected/BlogErrorHandler.php | |
parent | 3e4e6e66aeb3f8fea4e1eb4237498ef9d2358f63 (diff) |
standardize the use of unix eol; use svn properties to enforce native eol
Diffstat (limited to 'demos/blog-tutorial/samples/day5/blog/protected/BlogErrorHandler.php')
-rw-r--r-- | demos/blog-tutorial/samples/day5/blog/protected/BlogErrorHandler.php | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/demos/blog-tutorial/samples/day5/blog/protected/BlogErrorHandler.php b/demos/blog-tutorial/samples/day5/blog/protected/BlogErrorHandler.php index 56b71f8a..e8908ba7 100644 --- a/demos/blog-tutorial/samples/day5/blog/protected/BlogErrorHandler.php +++ b/demos/blog-tutorial/samples/day5/blog/protected/BlogErrorHandler.php @@ -1,40 +1,40 @@ -<?php
-
-Prado::using('System.Exceptions.TErrorHandler');
-Prado::using('Application.BlogException');
-
-class BlogErrorHandler extends TErrorHandler
-{
- /**
- * Retrieves the template used for displaying external exceptions.
- * This method overrides the parent implementation.
- */
- protected function getErrorTemplate($statusCode,$exception)
- {
- // use our own template for BlogException
- if($exception instanceof BlogException)
- {
- // get the path of the error template file: protected/error.html
- $templateFile=Prado::getPathOfNamespace('Application.error','.html');
- return file_get_contents($templateFile);
- }
- else // otherwise use the template defined by PRADO
- return parent::getErrorTemplate($statusCode,$exception);
- }
-
- /**
- * Handles external error caused by end-users.
- * This method overrides the parent implementation.
- * It is invoked by PRADO when an external exception is thrown.
- */
- protected function handleExternalError($statusCode,$exception)
- {
- // log the error (only for BlogException)
- if($exception instanceof BlogException)
- Prado::log($exception->getErrorMessage(),TLogger::ERROR,'BlogApplication');
- // call parent implementation to display the error
- parent::handleExternalError($statusCode,$exception);
- }
-}
-
+<?php + +Prado::using('System.Exceptions.TErrorHandler'); +Prado::using('Application.BlogException'); + +class BlogErrorHandler extends TErrorHandler +{ + /** + * Retrieves the template used for displaying external exceptions. + * This method overrides the parent implementation. + */ + protected function getErrorTemplate($statusCode,$exception) + { + // use our own template for BlogException + if($exception instanceof BlogException) + { + // get the path of the error template file: protected/error.html + $templateFile=Prado::getPathOfNamespace('Application.error','.html'); + return file_get_contents($templateFile); + } + else // otherwise use the template defined by PRADO + return parent::getErrorTemplate($statusCode,$exception); + } + + /** + * Handles external error caused by end-users. + * This method overrides the parent implementation. + * It is invoked by PRADO when an external exception is thrown. + */ + protected function handleExternalError($statusCode,$exception) + { + // log the error (only for BlogException) + if($exception instanceof BlogException) + Prado::log($exception->getErrorMessage(),TLogger::ERROR,'BlogApplication'); + // call parent implementation to display the error + parent::handleExternalError($statusCode,$exception); + } +} + ?>
\ No newline at end of file |