ProtectionException.class.php 622 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. /**
  3. * Protection exception
  4. *
  5. * Thrown if unexpected action or behaviour detected
  6. *
  7. * @author vesta, http://vestacp.com/
  8. * @author Dmitry Malishev <dima.malishev@gmail.com>
  9. * @copyright vesta 2010-2011
  10. */
  11. class ProtectionException extends Exception
  12. {
  13. const CODE_GENERAL = 0;
  14. /**
  15. * Protection exception
  16. */
  17. public function __construct($message, $code=self::CODE_GENERAL, $previous=null)
  18. {
  19. parent::__construct($message, $code, $previous);
  20. }
  21. /**
  22. * Renders error message
  23. */
  24. public function __toString()
  25. {
  26. print $this->message;
  27. }
  28. }
  29. ?>