private static CopyImageResponse checkCopyImageResponse(CopyImageResponse copyImageResponse) throws RpcException {
  logger.info("Checking {}",copyImageResponse);
switch (copyImageResponse.getResult()) {
case OK:
    break;
case IMAGE_NOT_FOUND:
  throw new ImageNotFoundException(copyImageResponse.getError());
case SYSTEM_ERROR:
throw new SystemErrorException(copyImageResponse.getError());
default :
throw new RpcException(String.format("Unexpected result: %s",copyImageResponse.getResult()));
}
return copyImageResponse;
}

private static CopyImageResponse checkCopyImageResponse ( CopyImageResponse copyImageResponse ) throws RpcException { logger . info ( "Checking {}" , copyImageResponse ) ; switch ( copyImageResponse . getResult ( ) ) { case OK : break ; case IMAGE_NOT_FOUND : throw new ImageNotFoundException ( copyImageResponse . getError ( ) ) ; case SYSTEM_ERROR : throw new SystemErrorException ( copyImageResponse . getError ( ) ) ; default : throw new RpcException ( String . format ( "Unexpected result: %s" , copyImageResponse . getResult ( ) ) ) ; } return copyImageResponse ; }
this method validates a copyimageresponse object , raising an exception if the response reflects an operation failure .
