Skip to content

Commit

Permalink
Merge pull request #6233 from Thisara-Welmilla/fix-error-code
Browse files Browse the repository at this point in the history
Improve error codes for user defined local authenticator mgt.
  • Loading branch information
Thisara-Welmilla authored Jan 2, 2025
2 parents 67c962a + 777e361 commit 949dbd8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,17 @@ public static AuthenticatorMgtServerRuntimeException buildRuntimeServerException
public enum AuthenticatorMgtError {

// Client errors.
ERROR_NOT_FOUND_AUTHENTICATOR("60001", "No Authenticator found.",
ERROR_NOT_FOUND_AUTHENTICATOR("60010", "No Authenticator found.",
"No Authenticator found by given authenticator name: %s."),
ERROR_OPERATION_ALLOWED_FOR_SYSTEM_AUTHENTICATOR("60002", "No operations allowed on system " +
"authenticators.", "Do not allow to perform any operation on system defined authenticator: %s."),
ERROR_AUTHENTICATOR_ALREADY_EXIST("60003", "The authenticator already exists.",
ERROR_CODE_INVALID_ENDPOINT_CONFIG("60011", "Invalid endpoint configuration provided.",
"Invalid endpoint configuration is provided for the authenticator %s."),
ERROR_CODE_ERROR_AUTHENTICATOR_NOT_FOUND("60012", "Authenticator not found.",
"Authenticator not found by the given name: %s."),
ERROR_AUTHENTICATOR_ALREADY_EXIST("60013", "The authenticator already exists.",
"The authenticator already exists for the given name: %s."),
ERROR_INVALID_AUTHENTICATOR_NAME("60004", "Authenticator name is invalid.",
ERROR_INVALID_AUTHENTICATOR_NAME("60014", "Authenticator name is invalid.",
"The provided authenticator name %s is not in the expected format %s."),
ERROR_BLANK_FIELD_VALUE("60004", "Invalid empty or blank value.",
ERROR_BLANK_FIELD_VALUE("60015", "Invalid empty or blank value.",
"Value for %s should not be empty or blank."),

// Server errors.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ private static AuthenticatorMgtException handleActionMgtException(AuthenticatorM
if (actionException instanceof ActionMgtClientException) {
ActionMgtClientException error = (ActionMgtClientException) actionException;
throw new AuthenticatorMgtClientException(
authenticatorMgtError.getCode(), error.getMessage(), error.getDescription());
authenticatorMgtError.getCode(), authenticatorMgtError.getMessage(), error.getDescription());
}

throw buildServerException(authenticatorMgtError, data);
Expand Down

0 comments on commit 949dbd8

Please sign in to comment.