Skip to content

Commit

Permalink
Fix error message usage.
Browse files Browse the repository at this point in the history
  • Loading branch information
Thisara-Welmilla committed Dec 3, 2024
1 parent eb2c7e7 commit 78ad1f7
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}

Expand Down Expand Up @@ -282,7 +282,7 @@ private static void validateSamlMetadata(List<Property> 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());
}
}
}
Expand Down Expand Up @@ -313,7 +313,7 @@ private static void validateDuplicateOpenIDConnectScopes(List<Property> 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());
}
}
}
Expand All @@ -333,7 +333,7 @@ private static void validateDefaultOpenIDConnectScopes(List<Property> 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());
}
}
}
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 78ad1f7

Please sign in to comment.