Class ErrorGroups

java.lang.Object
org.apache.ignite.lang.ErrorGroups

public class ErrorGroups extends Object
Defines error groups and its errors.
  • Field Details

    • IGNITE_ERR_PREFIX

      public static final String IGNITE_ERR_PREFIX
      Additional prefix that is used in a human-readable format of ignite errors.
      See Also:
  • Constructor Details

    • ErrorGroups

      public ErrorGroups()
  • Method Details

    • initialize

      public static void initialize()
      Initializes and register all error groups and error codes.
    • registerGroup

      public static ErrorGroup registerGroup(String groupName, short groupCode)
      Creates a new error group with the given groupName and groupCode and default error prefix.
      Parameters:
      groupName - Group name to be created.
      groupCode - Group code to be created.
      Returns:
      New error group.
      Throws:
      IllegalArgumentException - If the specified name or group code already registered. Also, this exception is thrown if the given groupName is null or empty.
    • registerGroup

      public static ErrorGroup registerGroup(String errorPrefix, String groupName, short groupCode)
      Creates a new error group with the given groupName and groupCode.
      Parameters:
      errorPrefix - Error prefix which should be used for the created error group.
      groupName - Group name to be created.
      groupCode - Group code to be created.
      Returns:
      New error group.
      Throws:
      IllegalArgumentException - If the specified name or group code already registered. Also, this exception is thrown if the given groupName is null or empty.
    • extractCauseMessage

      @Nullable public static @Nullable String extractCauseMessage(String errorMessage)
      Returns a message extracted from the given errorMessage if this errorMessage matches EXCEPTION_MESSAGE_PATTERN. If errorMessage does not match the pattern or null then returns the original errorMessage.
      Parameters:
      errorMessage - Message that is returned by Throwable.getMessage()
      Returns:
      Extracted message.
    • extractGroupCode

      public static short extractGroupCode(int code)
      Returns group code extracted from the given full error code.
      Parameters:
      code - Full error code.
      Returns:
      Group code.
    • errorGroupByGroupCode

      public static ErrorGroup errorGroupByGroupCode(short groupCode)
      Returns error group identified by the given groupCode.
      Parameters:
      groupCode - Group code
      Returns:
      Error Group.
    • errorGroupByCode

      public static ErrorGroup errorGroupByCode(int code)
      Returns error group identified by the given error code.
      Parameters:
      code - Full error code
      Returns:
      Error Group.