A TRpcException represents a RPC fault i.e. an error that is caused by the input data sent from the client.
Since: 3.2
Author: Robin J. Rogge (rrogge@bigpoint.net)
Inheritance: extends Prado\Exceptions\TException
Exemplo n.º 1
0
 /**
  * Turns the given exception into an JSON RPC fault
  * @param TRpcException $exception
  * @return string JSON RPC fault
  */
 public function createErrorResponse(TRpcException $exception)
 {
     if ($this->_specificationVersion == 2.0) {
         return $this->encode(array('id' => $this->_id, 'result' => null, 'error' => array('code' => $exception->getCode(), 'message' => $exception->getMessage(), 'data' => null)));
     } else {
         return $this->encode(array('id' => $this->_id, 'error' => array('code' => $exception->getCode(), 'message' => $exception->getMessage(), 'data' => null)));
     }
 }
Exemplo n.º 2
0
 /**
  * Turns the given exception into an XML RPC fault
  * @param TRpcException $exception
  * @return string XML RPC fault
  */
 public function createErrorResponse(TRpcException $exception)
 {
     return $this->encode(array('faultCode' => $exception->getCode(), 'faultString' => $exception->getMessage()));
 }