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

IGNITE-24150 Ability to have different prefixes for exceptions #4991

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

ygerzhedovich
Copy link
Contributor

/** Group name. */
private final String groupName;

/** Group code. */
private final short groupCode;

/** Additional prefix that is used in a human-readable format of error messages. */
private final String errorPrefix;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I'm a little confused by the name. Perhaps, it would be nice to change to groupNamePrefix, or vendorSpecificPrefix etc. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we honestly it's not so important and all variants reflect nature of the field but from different perspective

* @param message Original message.
* @return New error message with predefined prefix.
*/
static String errorMessage(String errorPrefix, UUID traceId, String groupName, int code, String message) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly, I don't like this idea. I mean creating a new class with duplicating code looks odd to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#4991 (comment)
We have two chairs here -introduce in public API method which not required for user and can be used wrong or make a small duplication.


/**
* Defines error groups and its errors.
*/
@SuppressWarnings("PublicInnerClass")
public class ErrorGroups {
/** Additional prefix that is used in a human-readable format of ignite errors. */
public static final String IGNITE_ERR_PREFIX = "IGN";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps, the following code should be updated as well

public const string ErrPrefix = "IGN-";

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants