A TRpcException represents a RPC fault i.e. an error that is caused by the input data sent from the client.
부터: 3.2
저자: Robin J. Rogge (rrogge@bigpoint.net)
상속: extends Prado\Exceptions\TException
예제 #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)));
     }
 }
예제 #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()));
 }