runtime/runtime_impl_jetty9/src/main/java/com/google/apphosting/runtime/http/HttpApiHostClient.java [265:297]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  static void receivedResponse(
      byte[] responseBytes,
      int responseLength,
      Context context,
      AnyRpcCallback<APIResponse> callback) {
    logger.atFine().log("Response size %d", responseLength);
    CodedInputStream input = CodedInputStream.newInstance(responseBytes, 0, responseLength);
    RemoteApiPb.Response responsePb;
    try {
      responsePb = RemoteApiPb.Response.parseFrom(input, ExtensionRegistry.getEmptyRegistry());
    } catch (UninitializedMessageException | IOException e) {
      String errorDetail = "Failed to parse RemoteApiPb.Response";
      logger.atWarning().withCause(e).log("%s", errorDetail);
      communicationFailure(context, errorDetail, callback, e);
      return;
    }

    if (responsePb.hasApplicationError()) {
      RemoteApiPb.ApplicationError applicationError = responsePb.getApplicationError();
      context.setApplicationError(applicationError.getCode());
      context.setErrorDetail(applicationError.getDetail());
      context.setStatus(StatusProto.getDefaultInstance());
      callback.failure();
      return;
    }

    APIResponse apiResponse =
        APIResponse.newBuilder()
            .setError(ApiProxyUtils.remoteApiErrorToApiResponseError(responsePb).getNumber())
            .setPb(responsePb.getResponse())
            .build();
    callback.success(apiResponse);
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



runtime/runtime_impl_jetty12/src/main/java/com/google/apphosting/runtime/http/HttpApiHostClient.java [265:297]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  static void receivedResponse(
      byte[] responseBytes,
      int responseLength,
      Context context,
      AnyRpcCallback<APIResponse> callback) {
    logger.atFine().log("Response size %d", responseLength);
    CodedInputStream input = CodedInputStream.newInstance(responseBytes, 0, responseLength);
    RemoteApiPb.Response responsePb;
    try {
      responsePb = RemoteApiPb.Response.parseFrom(input, ExtensionRegistry.getEmptyRegistry());
    } catch (UninitializedMessageException | IOException e) {
      String errorDetail = "Failed to parse RemoteApiPb.Response";
      logger.atWarning().withCause(e).log("%s", errorDetail);
      communicationFailure(context, errorDetail, callback, e);
      return;
    }

    if (responsePb.hasApplicationError()) {
      RemoteApiPb.ApplicationError applicationError = responsePb.getApplicationError();
      context.setApplicationError(applicationError.getCode());
      context.setErrorDetail(applicationError.getDetail());
      context.setStatus(StatusProto.getDefaultInstance());
      callback.failure();
      return;
    }

    APIResponse apiResponse =
        APIResponse.newBuilder()
            .setError(ApiProxyUtils.remoteApiErrorToApiResponseError(responsePb).getNumber())
            .setPb(responsePb.getResponse())
            .build();
    callback.success(apiResponse);
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



