// 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 IllegalArgumentException) {
throw new ServerApiException(BaseCmd.PARAM_ERROR, t.getMessage());
} else if (t instanceof PermissionDeniedException) {
PermissionDeniedException ref = (PermissionDeniedException)t;
ServerApiException ex = new ServerApiException(BaseCmd.ACCOUNT_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("PermissionDenied: " + t.getMessage() + "db_id: " + id.getValue());
}
} else {
s_logger.info("PermissionDenied: " + t.getMessage());
}
// Also copy over the cserror code.
ex.setCSErrorCode(ref.getCSErrorCode());
throw ex;
} else if (t instanceof AccountLimitException) {
AccountLimitException ref = (AccountLimitException)t;
ServerApiException ex = new ServerApiException(BaseCmd.ACCOUNT_RESOURCE_LIMIT_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 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.