private static CreateDisksResponse checkCreateDisksResponse(CreateDisksResponse createDisksResponse) throws RpcException {
  logger.info("Checking {}",createDisksResponse);
switch (createDisksResponse.getResult()) {
case OK:
    break;
case INVALID_RESERVATION:
  throw new InvalidReservationException(createDisksResponse.getError());
case SYSTEM_ERROR:
throw new SystemErrorException(createDisksResponse.getError());
default :
throw new RpcException(String.format("Unknown result: %s",createDisksResponse.getResult()));
}
return createDisksResponse;
}

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