Enum Class Error
- All Implemented Interfaces:
Serializable
,Comparable<Error>
,Constable
Enum representing different error types with corresponding error codes and messages.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
reportAndExit
(Error error, Optional<Exception> exception) Prints the error message to standard error and exits the program with the error code.toString()
Returns a string representation of the error.static Error
Returns the enum constant of this class with the specified name.static Error[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
UNKNOWN_ERROR
-
NULL_ERROR
-
INVALID_REPOSITORY_URL
-
INVALID_REPO_PATHS
-
INVALID_REPO_PATH
-
INVALID_CONFIG_PATH
-
REPO_DONT_EXIST
-
GIT_FAILED
-
INVALID_ARGS
-
INVALID_JSON_READ
-
INVALID_JSON_WRITE
-
JPARSE_FAILED
-
INVALID_CONFIG
-
MISSING_CONFIG
-
-
Field Details
-
code
private final int codeThe unique error code identifying the error type. -
message
The detailed message describing the error.
-
-
Constructor Details
-
Error
Constructor for Error enum.- Parameters:
code
- The error code.message
- The error message.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
reportAndExit
Prints the error message to standard error and exits the program with the error code.- Parameters:
error
- The error enum value to report and exit with.
-
toString
Returns a string representation of the error.
-