/** * 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))); } }
/** * 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())); }