private static GetImagesResponse checkGetImagesResponse(GetImagesResponse getImagesResponse) throws RpcException {
  logger.info("Checking {}",getImagesResponse);
switch (getImagesResponse.getResult()) {
case OK:
    break;
case DATASTORE_NOT_FOUND:
  throw new DatastoreNotFoundException(getImagesResponse.getError());
case SYSTEM_ERROR:
throw new SystemErrorException(getImagesResponse.getError());
default :
throw new RpcException(String.format("Unknown result: %s",getImagesResponse.getResult()));
}
return getImagesResponse;
}

private static GetImagesResponse checkGetImagesResponse ( GetImagesResponse getImagesResponse ) throws RpcException { logger . info ( "Checking {}" , getImagesResponse ) ; switch ( getImagesResponse . getResult ( ) ) { case OK : break ; case DATASTORE_NOT_FOUND : throw new DatastoreNotFoundException ( getImagesResponse . getError ( ) ) ; case SYSTEM_ERROR : throw new SystemErrorException ( getImagesResponse . getError ( ) ) ; default : throw new RpcException ( String . format ( "Unknown result: %s" , getImagesResponse . getResult ( ) ) ) ; } return getImagesResponse ; }
this method validates a getimagesresponse object , raising an exception if the response reflects an operation failure .
