diff --git a/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/dao/ApiMgtDAO.java b/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/dao/ApiMgtDAO.java index c2691f23e52d..e50ac8747e7c 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/dao/ApiMgtDAO.java +++ b/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/dao/ApiMgtDAO.java @@ -14030,12 +14030,10 @@ public List getBlockConditions(String tenantDomain) throws A try { connection.rollback(); } catch (SQLException ex) { - throw new APIManagementException("Failed to rollback getting Block conditions.", - ExceptionCodes.BLOCK_CONDITION_RETRIEVE_FAILED); + handleException("Failed to rollback getting Block conditions.", ex); } } - throw new APIManagementException("Failed to retrieve all block conditions for the tenant " + tenantDomain, - ExceptionCodes.BLOCK_CONDITION_RETRIEVE_FAILED); + handleException("Failed to retrieve all block conditions for the tenant " + tenantDomain, e); } finally { APIMgtDBUtil.closeAllConnections(selectPreparedStatement, connection, resultSet); } @@ -14086,9 +14084,9 @@ public List getBlockConditionsByConditionTypeAndValue(String blockConditionsDTOList.add(blockConditionsDTO); } } catch (SQLException e) { - throw new APIManagementException( - "Failed to get Block conditions by condition type: " + conditionType + " and condition value: " - + conditionValue, ExceptionCodes.BLOCK_CONDITION_RETRIEVE_FAILED); + handleException( + "Failed to get Block conditions by condition type: " + conditionType + " and condition value: " + conditionValue, + e); } finally { APIMgtDBUtil.closeAllConnections(selectPreparedStatement, connection, resultSet); }