From 78ad1f71ec10c9cca45eff9def75b2f0fb928f6a Mon Sep 17 00:00:00 2001 From: Thisara-Welmilla Date: Tue, 3 Dec 2024 23:09:53 +0530 Subject: [PATCH] Fix error message usage. --- .../FederatedAuthenticatorConfigBuilderFactory.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/main/java/org/wso2/carbon/identity/api/server/idp/v1/impl/FederatedAuthenticatorConfigBuilderFactory.java b/components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/main/java/org/wso2/carbon/identity/api/server/idp/v1/impl/FederatedAuthenticatorConfigBuilderFactory.java index 2d8b8c9906..a97661b381 100644 --- a/components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/main/java/org/wso2/carbon/identity/api/server/idp/v1/impl/FederatedAuthenticatorConfigBuilderFactory.java +++ b/components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/main/java/org/wso2/carbon/identity/api/server/idp/v1/impl/FederatedAuthenticatorConfigBuilderFactory.java @@ -238,7 +238,7 @@ private static void validateAuthenticatorProperties(String authenticatorName, Li if (!areAllDistinct(properties)) { Constants.ErrorMessage error = Constants.ErrorMessage.ERROR_CODE_INVALID_INPUT; - throw new IdentityProviderManagementClientException(error.getCode(), error.getDescription()); + throw new IdentityProviderManagementClientException(error.getCode(), error.getMessage()); } } @@ -282,7 +282,7 @@ private static void validateSamlMetadata(List samlAuthenticatorPropert samlAuthenticatorProperties.set(positionOfMetadataKey, metadataProperty); } else { Constants.ErrorMessage error = Constants.ErrorMessage.ERROR_CODE_INVALID_SAML_METADATA; - throw new IdentityProviderManagementClientException(error.getCode(), error.getDescription()); + throw new IdentityProviderManagementClientException(error.getCode(), error.getMessage()); } } } @@ -313,7 +313,7 @@ private static void validateDuplicateOpenIDConnectScopes(List oidcAuth } if (scopesFieldFilled && queryParamsScopesFilled) { Constants.ErrorMessage error = Constants.ErrorMessage.ERROR_CODE_DUPLICATE_OIDC_SCOPES; - throw new IdentityProviderManagementClientException(error.getCode(), error.getDescription()); + throw new IdentityProviderManagementClientException(error.getCode(), error.getMessage()); } } } @@ -333,7 +333,7 @@ private static void validateDefaultOpenIDConnectScopes(List oidcAuthen String scopes = oidcAuthenticatorProperty.getValue(); if (StringUtils.isNotBlank(scopes) && !scopes.contains("openid")) { Constants.ErrorMessage error = Constants.ErrorMessage.ERROR_CODE_INVALID_OIDC_SCOPES; - throw new IdentityProviderManagementClientException(error.getCode(), error.getDescription()); + throw new IdentityProviderManagementClientException(error.getCode(), error.getMessage()); } } } @@ -389,7 +389,7 @@ private static String getDisplayNameOfAuthenticator(String authenticatorName) } } catch (IdentityProviderManagementException e) { Constants.ErrorMessage error = Constants.ErrorMessage.ERROR_CODE_ERROR_ADDING_IDP; - throw new IdentityProviderManagementClientException(error.getCode(), error.getDescription()); + throw new IdentityProviderManagementClientException(error.getCode(), error.getMessage()); } return null; }