Package com.cloud.exception

Examples of com.cloud.exception.InsufficientCapacityException


                }
                // Also copy over the cserror code.
          ex.setCSErrorCode(ref.getCSErrorCode());
                throw ex;
            } else if (t instanceof InsufficientCapacityException) {             
              InsufficientCapacityException ref = (InsufficientCapacityException)t;
              ServerApiException ex = new ServerApiException(BaseCmd.INSUFFICIENT_CAPACITY_ERROR, t.getMessage());
                // copy over the IdentityProxy information as well and throw the serverapiexception.
              ArrayList<IdentityProxy> idList = ref.getIdProxyList();
                if (idList != null) {
                  // Iterate through entire arraylist and copy over each proxy id.
                  for (int i = 0 ; i < idList.size(); i++) {
                     IdentityProxy id = idList.get(i);
                     ex.addProxyObject(id.getTableName(), id.getValue(), id.getidFieldName());
                     s_logger.info(t.getMessage() + "db_id: " + id.getValue());
                  }
                } else {
                  s_logger.info(t.getMessage());
                }
                // Also copy over the cserror code
          ex.setCSErrorCode(ref.getCSErrorCode());
                throw ex;
            } else if (t instanceof ResourceAllocationException) {
              ResourceAllocationException ref = (ResourceAllocationException)t;
                ServerApiException ex = new ServerApiException(BaseCmd.RESOURCE_ALLOCATION_ERROR, t.getMessage());
                // copy over the IdentityProxy information as well and throw the serverapiexception.
                ArrayList<IdentityProxy> idList = ref.getIdProxyList();
                if (idList != null) {
                  // Iterate through entire arraylist and copy over each proxy id.
                  for (int i = 0 ; i < idList.size(); i++) {
                     IdentityProxy id = idList.get(i);
                     ex.addProxyObject(id.getTableName(), id.getValue(), id.getidFieldName());
                     s_logger.warn("Exception: " + t.getMessage() + "db_id: " + id.getValue());
                  }
                } else {
                  s_logger.warn("Exception: ", t);
                }
                // Also copy over the cserror code.
          ex.setCSErrorCode(ref.getCSErrorCode());
                throw ex;
            } else if (t instanceof ResourceUnavailableException) {
              ResourceUnavailableException ref = (ResourceUnavailableException)t;
                ServerApiException ex = new ServerApiException(BaseCmd.RESOURCE_UNAVAILABLE_ERROR, t.getMessage());
                // copy over the IdentityProxy information as well and throw the serverapiexception.
                ArrayList<IdentityProxy> idList = ref.getIdProxyList();
                if (idList != null) {
                  // Iterate through entire arraylist and copy over each proxy id.
                  for (int i = 0 ; i < idList.size(); i++) {
                     IdentityProxy id = idList.get(i);
                     ex.addProxyObject(id.getTableName(), id.getValue(), id.getidFieldName());
                     s_logger.warn("Exception: " + t.getMessage() + "db_id: " + id.getValue());
                  }
                } else {
                  s_logger.warn("Exception: ", t);
                }
                // Also copy over the cserror code.
          ex.setCSErrorCode(ref.getCSErrorCode());
                throw ex;
            } else if (t instanceof AsyncCommandQueued) {             
                throw (AsyncCommandQueued) t;
            } else if (t instanceof ServerApiException) {
                s_logger.warn(t.getClass() + " : " + ((ServerApiException) t).getDescription());
View Full Code Here

TOP

Related Classes of com.cloud.exception.InsufficientCapacityException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.