/demos/Zend/Wildfire/application/controllers/ErrorController.php

https://github.com/decaoz/zf1 · PHP · 51 lines · 11 code · 7 blank · 33 comment · 0 complexity · eae35a852c419802ea2efe7820dc1a4e MD5 · raw file

  1. <?php
  2. /**
  3. * Zend Framework
  4. *
  5. * LICENSE
  6. *
  7. * This source file is subject to the new BSD license that is bundled
  8. * with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://framework.zend.com/license/new-bsd
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@zend.com so we can send you a copy immediately.
  14. *
  15. * @category Zend
  16. * @package Zend_Wildfire
  17. * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
  18. * @license http://framework.zend.com/license/new-bsd New BSD License
  19. */
  20. /**
  21. * A sample error controller.
  22. *
  23. * @category Zend
  24. * @package Zend_Wildfire
  25. * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
  26. * @license http://framework.zend.com/license/new-bsd New BSD License
  27. */
  28. class ErrorController extends Zend_Controller_Action
  29. {
  30. public function errorAction()
  31. {
  32. /*
  33. * Make sure we don't log exceptions thrown during the exception logging.
  34. * If we do we will create an infinite loop!
  35. */
  36. try {
  37. Zend_Registry::get('logger')->err($this->_getParam('error_handler')->exception);
  38. } catch(Exception $e) {
  39. /* TODO: You can log this exception somewhere or display it during development.
  40. * DO NOT USE THE logger here as it will create an infinite loop!
  41. */
  42. }
  43. }
  44. }