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)));
}
}