Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return client error responses as structured JSON in the User Sharing API #823

Merged
merged 5 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
public class UserSharingMgtConstants {

public static final String ERROR_PREFIX = "USM-";
public static final String ERROR_UNSUPPORTED_PARAM = "Unsupported param.";

public static final String USER_IDS = "userIds";

Expand All @@ -44,23 +43,28 @@ public enum ErrorMessage {
INVALID_SELECTIVE_USER_SHARE_REQUEST_BODY("60000",
"Invalid selective user share request body.",
"The user criteria provided for selective sharing is either null or empty. " +
"Please provide valid criteria."),
"Please provide valid selective user sharing criteria."),
INVALID_GENERAL_USER_SHARE_REQUEST_BODY("60001",
"Invalid general user share request body.",
"The user criteria provided for general sharing is either null or empty. " +
"Please provide valid criteria."),
"Please provide valid general user sharing criteria."),
INVALID_SELECTIVE_USER_UNSHARE_REQUEST_BODY("60002",
"Invalid selective user unshare request body.",
"The user criteria provided for selective unsharing is either null or empty. " +
"Please provide valid criteria."),
"Please provide valid selective user unsharing criteria."),
INVALID_GENERAL_USER_UNSHARE_REQUEST_BODY("60003",
"Invalid general user unshare request body.",
"The user criteria provided for general unsharing is either null or empty. " +
"Please provide valid criteria."),
"Please provide valid general user unsharing criteria."),
INVALID_UUID_FORMAT("60004",
"Invalid UUID format.",
"The UUID provided in the request is not in a valid format. " +
"Please provide a valid UUID.");
"Please provide a valid UUID."),

// Server errors.
ERROR_INITIATING_USERS_API_SERVICE("65001",
"Error initiating UsersApiService.",
"Error occurred while initiating UsersApiService.");

private final String code;
private final String message;
Expand Down
Loading
Loading