11package dev .le_app .mcss_api_java ;
22
3+ /** List of possible errors of the API */
34public enum Errors {
45
56 //General Purpose
7+
8+ /** Unauthorized */
69 UNAUTHORIZED ("API Token is invalid or expired. (ERR_401)" ),
10+ /** Not Found */
711 NOT_FOUND ("TaskID / ServerID / BackupID invalid. (ERR_404)" ),
12+ /** Version not supported */
813 VERSION_MISMATCH ("API version mismatch. Expected version: {VERSION}, got {GOT}" ),
14+ /** Error code was not recognized */
915 NOT_RECOGNIZED ("Error code not recognized. (ERR_UNKNOWN): " ),
16+ /** API doesn't have access to this server */
1017 NO_SERVER_ACCESS ("You do not have access to this server. (ERR_403)" ),
1118
19+ /** Filter error */
1220 ID_FILTER_ERROR ("The serverTypeID is only required if the filter is set to FILTER" ),
1321
1422 //Tasks - Job Messages
23+ /** Task details are invalid */
1524 INVALID_TASK_DETAILS ("Task details are invalid. (ERR_409)" ),
25+ /** Task name contains special chars */
1626 NAME_SPECIAL_CHAR ("Task name cannot contain special characters." ),
1727
28+ /** Task is already deleted */
1829 TASK_ALREADY_DELETED ("Task has already been deleted." ),
30+ /** Task has been deleted */
1931 TASK_DELETED ("Cannot edit/execute a deleted task." ),
32+ /** Task Deleted - JOB */
2033 JOB_DELETED ("Cannot get Job of a deleted task." ),
34+ /** Task Deleted - ENABLE */
2135 ENABLE_DELETED ("Cannot enable a deleted task." ),
36+ /** Task Deleted - DISABLE */
2237 DISABLE_DELETED ("Cannot disable a deleted task." ),
38+ /** Task Deleted - REPEAT */
2339 REPEAT_DELETED ("Cannot repeat a deleted task." ),
40+ /** Task Deleted - RUN */
2441 RUN_DELETED ("Cannot run a deleted task." ),
42+ /** Task Deleted - CHANGE NAME */
2543 CHANGE_NAME_DELETED ("Cannot change name of a deleted task." ),
44+ /** Task Deleted - TIMING */
2645 INTERVAL_DELETED ("Cannot get/set interval of a deleted task." ),
46+ /** Task Deleted - TIMING */
2747 TIME_DELETED ("Cannot get/set time of a deleted task." ),
2848
49+ /** Task doesn't have a valid job type */
2950 INVALID_JOB_TYPE ("Task has invalid Job type." ),
51+ /** Task has no timing information */
3052 NO_TIMING_INFORMATION ("Task has no timing information." ),
53+ /** Task time was invalid */
3154 COULD_NOT_PARSE_TIME ("Could not parse time to LocalTime." ),
3255
56+ /** Cannot repeat a timeless task */
3357 REPEAT_TIMELESS ("Timeless tasks cannot be repeated." ),
58+ /** Cannot get time for a timeless task */
3459 TIME_TIMELESS ("Timeless tasks don't have time details." ),
60+ /** Cannot get interval for a timeless task */
3561 INTERVAL_TIMELESS ("Timeless tasks don't have an interval." ),
62+ /** Cannot enable a timeless task */
3663 ENABLE_TIMELESS ("Timeless tasks cannot be enabled." ),
64+ /** Cannot disable a timeless task */
3765 DISABLE_TIMELESS ("Timeless tasks cannot be disabled." ),
3866
67+ /** Cannot get time of interval task */
3968 TIME_INTERVAL ("Interval tasks don't have time details." ),
69+ /** Interval must be more than 0 */
4070 INTERVAL_GREATER_0 ("Interval must be greater than 0." ),
4171
72+ /** Cannot get interval of time task */
4273 INTERVAL_FIXED_TIME ("Fixed time tasks don't have an interval." ),
4374
75+ /** No Commands found for task */
4476 COMMANDS_NOT_FOUND ("No commands found for this task." ),
77+ /** No Commands given for task */
4578 COMMANDS_NOT_GIVEN ("No commands were supplied for this task." ),
4679
80+ /** Method not available for this job type */
4781 METHOD_NOT_SUPPORTED ("This method is not supported for this job type." ),
4882
83+ /** Task doesn't have an action */
4984 ACTION_NOT_FOUND ("No action found for this task." );
5085
5186 private final String message ;
@@ -54,6 +89,10 @@ public enum Errors {
5489 this .message = message ;
5590 }
5691
92+ /**
93+ * Gets the message of the error.
94+ * @return The message of the error.
95+ */
5796 public String getMessage () {
5897 return message ;
5998 }
0 commit comments