MessageException.class.php 879 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /**
  3. * Custom exception for signalling display of a message to user
  4. *
  5. * @author Christopher Han <xiphux@gmail.com>
  6. * @copyright Copyright (c) 2010 Christopher Han
  7. * @package GitPHP
  8. * @subpackage Exception
  9. */
  10. class GitPHP_MessageException extends Exception
  11. {
  12. /**
  13. * Whether this is an error or informational
  14. *
  15. * @var boolean
  16. */
  17. public $Error;
  18. /**
  19. * HTTP status code
  20. *
  21. * @var integer
  22. */
  23. public $StatusCode;
  24. /**
  25. * Constructor
  26. *
  27. * @param string $message message string
  28. * @param boolean $error true if this is an error rather than informational
  29. * @param integer $statusCode HTTP status code to return
  30. * @param integer $code exception code
  31. */
  32. public function __construct($message, $error = false, $statusCode = 200, $code = 0) {
  33. $this->Error = $error;
  34. $this->StatusCode = $statusCode;
  35. parent::__construct($message, $code);
  36. }
  37. }