You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
566 B

  1. <?php
  2. /**
  3. * @copyright NetMonsters <team@netmonsters.ru>
  4. * @link http://netmonsters.ru
  5. * @package Majestic
  6. * @subpackage exception
  7. * @since 2010-02-26
  8. * @version SVN: $Id$
  9. * @filesource $URL$
  10. */
  11. class GeneralException extends Exception
  12. {
  13. protected $code = 500;
  14. protected function sendHeader()
  15. {
  16. if (!headers_sent()) {
  17. header('HTTP/1.0 500 Internal Server Error');
  18. }
  19. }
  20. public function toHtml()
  21. {
  22. $this->sendHeader();
  23. return 'Exception caught: ' . $this->getMessage();
  24. }
  25. }