diff options
author | Frederic Guillot <fred@kanboard.net> | 2017-10-25 16:22:10 -0700 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2017-10-25 16:22:10 -0700 |
commit | 9e2b2a32fd0e967ad3184e9a5d091a29953acb91 (patch) | |
tree | 00822e24aa1110c73ca455a8d096ef296c008cbc /vendor/fguillot/json-rpc/src/JsonRPC/Exception/ResponseException.php | |
parent | c507c5416251c505cb3e088a03c6664bed73c812 (diff) |
Include composer dependencies in repo
Diffstat (limited to 'vendor/fguillot/json-rpc/src/JsonRPC/Exception/ResponseException.php')
-rw-r--r-- | vendor/fguillot/json-rpc/src/JsonRPC/Exception/ResponseException.php | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/vendor/fguillot/json-rpc/src/JsonRPC/Exception/ResponseException.php b/vendor/fguillot/json-rpc/src/JsonRPC/Exception/ResponseException.php new file mode 100644 index 00000000..98fb5c67 --- /dev/null +++ b/vendor/fguillot/json-rpc/src/JsonRPC/Exception/ResponseException.php @@ -0,0 +1,62 @@ +<?php + +namespace JsonRPC\Exception; + +use Exception; + +/** + * Class ResponseException + * + * @package JsonRPC\Exception + * @author Frederic Guillot + */ +class ResponseException extends Exception +{ + /** + * A value that contains additional information about the error. + * + * @access protected + * @link http://www.jsonrpc.org/specification#error_object + * @var mixed + */ + protected $data; + + /** + * Constructor + * + * @access public + * @param string $message [optional] The Exception message to throw. + * @param int $code [optional] The Exception code. + * @param Exception $previous [optional] The previous exception used for the exception chaining. Since 5.3.0 + * @param mixed $data [optional] A value that contains additional information about the error. + */ + public function __construct($message = '', $code = 0, Exception $previous = null, $data = null) + { + parent::__construct($message, $code, $previous); + $this->setData($data); + } + + /** + * Attach additional information + * + * @access public + * @param mixed $data [optional] A value that contains additional information about the error. + * @return \JsonRPC\Exception\ResponseException + */ + public function setData($data = null) + { + $this->data = $data; + return $this; + } + + /** + * Get additional information + * + * @access public + * @return mixed|null + */ + public function getData() + { + return $this->data; + } +} |