2011-06-14 00:22:25 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Protection exception
|
|
|
|
|
*
|
|
|
|
|
* Thrown if unexpected action or behaviour detected
|
|
|
|
|
*
|
2011-06-20 18:26:03 +03:00
|
|
|
* @author Malishev Dima <dima.malishev@gmail.com>
|
2011-06-14 00:22:25 +03:00
|
|
|
* @author vesta, http://vestacp.com/
|
2011-06-20 18:26:03 +03:00
|
|
|
* @copyright vesta 2010-2011
|
2011-06-14 00:22:25 +03:00
|
|
|
*/
|
2011-06-20 18:26:03 +03:00
|
|
|
class ProtectionException extends Exception
|
|
|
|
|
{
|
2011-06-14 00:22:25 +03:00
|
|
|
const CODE_GENERAL = 0;
|
|
|
|
|
|
2011-06-21 13:32:26 +03:00
|
|
|
/**
|
|
|
|
|
* Protection exception
|
|
|
|
|
*/
|
2011-06-20 18:26:03 +03:00
|
|
|
public function __construct($message, $code=self::CODE_GENERAL, $previous=null)
|
|
|
|
|
{
|
2011-06-14 00:22:25 +03:00
|
|
|
parent::__construct($message, $code, $previous);
|
|
|
|
|
}
|
|
|
|
|
|
2011-06-21 13:32:26 +03:00
|
|
|
/**
|
|
|
|
|
* Renders error message
|
|
|
|
|
*/
|
2011-06-20 18:26:03 +03:00
|
|
|
public function __toString()
|
|
|
|
|
{
|
2011-06-14 00:22:25 +03:00
|
|
|
print $this->message;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
?>
|