String jsonResponse = callService(data);
JsonElement jsonTree = new JsonParser().parse(jsonResponse);
JsonObject response = jsonTree.getAsJsonObject();
ErrorData error = gson.fromJson(response.get("error"), Error.ErrorData.class);
if (null != error) {
String serviceError = "Received error from service: " + error.message;
if (error.code == Error.INTERNAL_ERROR) {
throw new InternalErrorException(serviceError);