handlerResult method

dynamic handlerResult(
  1. dynamic url,
  2. dynamic body,
  3. dynamic data
)

Implementation

handlerResult(url, body, data) {
  if (null == data) {
    throw EmptyResponseException(url);
  }
  var json = jsonDecode(data);
  if (null == json) {
    throw EmptyResponseException(url);
  }
  if (null != json["error"]) {
    var error = json["error"];
    throw RPCErrorException(RPCError(error["code"], error["message"]), url);
  }
  return json['result'];
}