Skip to content

Commit

Permalink
Add check for resource type not exist error
Browse files Browse the repository at this point in the history
  • Loading branch information
ThaminduR committed Oct 28, 2023
1 parent fa96ea9 commit 3fa88af
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
import javax.xml.transform.TransformerException;

import static org.wso2.carbon.identity.configuration.mgt.core.constant.ConfigurationConstants.ErrorMessages.ERROR_CODE_RESOURCE_DOES_NOT_EXISTS;
import static org.wso2.carbon.identity.configuration.mgt.core.constant.ConfigurationConstants.ErrorMessages.ERROR_CODE_RESOURCE_TYPE_DOES_NOT_EXISTS;
import static org.wso2.carbon.identity.notification.sender.tenant.config.NotificationSenderManagementConstants.CHANNEL_TYPE_PROPERTY;
import static org.wso2.carbon.identity.notification.sender.tenant.config.NotificationSenderManagementConstants.DEFAULT_EMAIL_PUBLISHER;
import static org.wso2.carbon.identity.notification.sender.tenant.config.NotificationSenderManagementConstants.DEFAULT_HANDLER_NAME;
Expand Down Expand Up @@ -635,8 +636,9 @@ private boolean canSenderDelete(String senderName) throws NotificationSenderMana
throw handleApplicationMgtException(e, ERROR_CODE_VALIDATING_CONNECTED_APPS,
senderName);
} catch (ConfigurationManagementException e) {
if (e instanceof ConfigurationManagementClientException &&
ERROR_CODE_RESOURCE_DOES_NOT_EXISTS.getCode().equals(e.getErrorCode())) {
if (e instanceof ConfigurationManagementClientException && (
ERROR_CODE_RESOURCE_DOES_NOT_EXISTS.getCode().equals(e.getErrorCode())
|| ERROR_CODE_RESOURCE_TYPE_DOES_NOT_EXISTS.getCode().equals(e.getErrorCode()))) {
return true;
}
throw handleConfigurationMgtException(e, ERROR_CODE_VALIDATING_CONNECTED_APPS,
Expand Down

0 comments on commit 3fa88af

Please sign in to comment.