|
1 | 1 | package gocron
|
2 | 2 |
|
3 |
| -import "fmt" |
| 3 | +import ( |
| 4 | + "errors" |
| 5 | +) |
4 | 6 |
|
5 | 7 | // Public error definitions
|
6 | 8 | var (
|
7 |
| - ErrCronJobInvalid = fmt.Errorf("gocron: CronJob: invalid crontab") |
8 |
| - ErrCronJobParse = fmt.Errorf("gocron: CronJob: crontab parse failure") |
9 |
| - ErrDailyJobAtTimeNil = fmt.Errorf("gocron: DailyJob: atTime within atTimes must not be nil") |
10 |
| - ErrDailyJobAtTimesNil = fmt.Errorf("gocron: DailyJob: atTimes must not be nil") |
11 |
| - ErrDailyJobHours = fmt.Errorf("gocron: DailyJob: atTimes hours must be between 0 and 23 inclusive") |
12 |
| - ErrDailyJobZeroInterval = fmt.Errorf("gocron: DailyJob: interval must be greater than 0") |
13 |
| - ErrDailyJobMinutesSeconds = fmt.Errorf("gocron: DailyJob: atTimes minutes and seconds must be between 0 and 59 inclusive") |
14 |
| - ErrDurationJobIntervalZero = fmt.Errorf("gocron: DurationJob: time interval is 0") |
15 |
| - ErrDurationRandomJobMinMax = fmt.Errorf("gocron: DurationRandomJob: minimum duration must be less than maximum duration") |
16 |
| - ErrEventListenerFuncNil = fmt.Errorf("gocron: eventListenerFunc must not be nil") |
17 |
| - ErrJobNotFound = fmt.Errorf("gocron: job not found") |
18 |
| - ErrJobRunNowFailed = fmt.Errorf("gocron: Job: RunNow: scheduler unreachable") |
19 |
| - ErrMonthlyJobDays = fmt.Errorf("gocron: MonthlyJob: daysOfTheMonth must be between 31 and -31 inclusive, and not 0") |
20 |
| - ErrMonthlyJobAtTimeNil = fmt.Errorf("gocron: MonthlyJob: atTime within atTimes must not be nil") |
21 |
| - ErrMonthlyJobAtTimesNil = fmt.Errorf("gocron: MonthlyJob: atTimes must not be nil") |
22 |
| - ErrMonthlyJobDaysNil = fmt.Errorf("gocron: MonthlyJob: daysOfTheMonth must not be nil") |
23 |
| - ErrMonthlyJobHours = fmt.Errorf("gocron: MonthlyJob: atTimes hours must be between 0 and 23 inclusive") |
24 |
| - ErrMonthlyJobZeroInterval = fmt.Errorf("gocron: MonthlyJob: interval must be greater than 0") |
25 |
| - ErrMonthlyJobMinutesSeconds = fmt.Errorf("gocron: MonthlyJob: atTimes minutes and seconds must be between 0 and 59 inclusive") |
26 |
| - ErrNewJobTaskNil = fmt.Errorf("gocron: NewJob: Task must not be nil") |
27 |
| - ErrNewJobTaskNotFunc = fmt.Errorf("gocron: NewJob: Task.Function must be of kind reflect.Func") |
28 |
| - ErrNewJobWrongNumberOfParameters = fmt.Errorf("gocron: NewJob: Number of provided parameters does not match expected") |
29 |
| - ErrNewJobWrongTypeOfParameters = fmt.Errorf("gocron: NewJob: Type of provided parameters does not match expected") |
30 |
| - ErrOneTimeJobStartDateTimePast = fmt.Errorf("gocron: OneTimeJob: start must not be in the past") |
31 |
| - ErrStopExecutorTimedOut = fmt.Errorf("gocron: timed out waiting for executor to stop") |
32 |
| - ErrStopJobsTimedOut = fmt.Errorf("gocron: timed out waiting for jobs to finish") |
33 |
| - ErrStopSchedulerTimedOut = fmt.Errorf("gocron: timed out waiting for scheduler to stop") |
34 |
| - ErrWeeklyJobAtTimeNil = fmt.Errorf("gocron: WeeklyJob: atTime within atTimes must not be nil") |
35 |
| - ErrWeeklyJobAtTimesNil = fmt.Errorf("gocron: WeeklyJob: atTimes must not be nil") |
36 |
| - ErrWeeklyJobDaysOfTheWeekNil = fmt.Errorf("gocron: WeeklyJob: daysOfTheWeek must not be nil") |
37 |
| - ErrWeeklyJobHours = fmt.Errorf("gocron: WeeklyJob: atTimes hours must be between 0 and 23 inclusive") |
38 |
| - ErrWeeklyJobZeroInterval = fmt.Errorf("gocron: WeeklyJob: interval must be greater than 0") |
39 |
| - ErrWeeklyJobMinutesSeconds = fmt.Errorf("gocron: WeeklyJob: atTimes minutes and seconds must be between 0 and 59 inclusive") |
40 |
| - ErrPanicRecovered = fmt.Errorf("gocron: panic recovered") |
41 |
| - ErrWithClockNil = fmt.Errorf("gocron: WithClock: clock must not be nil") |
42 |
| - ErrWithContextNil = fmt.Errorf("gocron: WithContext: context must not be nil") |
43 |
| - ErrWithDistributedElectorNil = fmt.Errorf("gocron: WithDistributedElector: elector must not be nil") |
44 |
| - ErrWithDistributedLockerNil = fmt.Errorf("gocron: WithDistributedLocker: locker must not be nil") |
45 |
| - ErrWithDistributedJobLockerNil = fmt.Errorf("gocron: WithDistributedJobLocker: locker must not be nil") |
46 |
| - ErrWithIdentifierNil = fmt.Errorf("gocron: WithIdentifier: identifier must not be nil") |
47 |
| - ErrWithLimitConcurrentJobsZero = fmt.Errorf("gocron: WithLimitConcurrentJobs: limit must be greater than 0") |
48 |
| - ErrWithLocationNil = fmt.Errorf("gocron: WithLocation: location must not be nil") |
49 |
| - ErrWithLoggerNil = fmt.Errorf("gocron: WithLogger: logger must not be nil") |
50 |
| - ErrWithMonitorNil = fmt.Errorf("gocron: WithMonitor: monitor must not be nil") |
51 |
| - ErrWithNameEmpty = fmt.Errorf("gocron: WithName: name must not be empty") |
52 |
| - ErrWithStartDateTimePast = fmt.Errorf("gocron: WithStartDateTime: start must not be in the past") |
53 |
| - ErrWithStopDateTimePast = fmt.Errorf("gocron: WithStopDateTime: end must not be in the past") |
54 |
| - ErrStartTimeLaterThanEndTime = fmt.Errorf("gocron: WithStartDateTime: start must not be later than end") |
55 |
| - ErrStopTimeEarlierThanStartTime = fmt.Errorf("gocron: WithStopDateTime: end must not be earlier than start") |
56 |
| - ErrWithStopTimeoutZeroOrNegative = fmt.Errorf("gocron: WithStopTimeout: timeout must be greater than 0") |
| 9 | + ErrCronJobInvalid = errors.New("gocron: CronJob: invalid crontab") |
| 10 | + ErrCronJobParse = errors.New("gocron: CronJob: crontab parse failure") |
| 11 | + ErrDailyJobAtTimeNil = errors.New("gocron: DailyJob: atTime within atTimes must not be nil") |
| 12 | + ErrDailyJobAtTimesNil = errors.New("gocron: DailyJob: atTimes must not be nil") |
| 13 | + ErrDailyJobHours = errors.New("gocron: DailyJob: atTimes hours must be between 0 and 23 inclusive") |
| 14 | + ErrDailyJobZeroInterval = errors.New("gocron: DailyJob: interval must be greater than 0") |
| 15 | + ErrDailyJobMinutesSeconds = errors.New("gocron: DailyJob: atTimes minutes and seconds must be between 0 and 59 inclusive") |
| 16 | + ErrDurationJobIntervalZero = errors.New("gocron: DurationJob: time interval is 0") |
| 17 | + ErrDurationRandomJobMinMax = errors.New("gocron: DurationRandomJob: minimum duration must be less than maximum duration") |
| 18 | + ErrEventListenerFuncNil = errors.New("gocron: eventListenerFunc must not be nil") |
| 19 | + ErrJobNotFound = errors.New("gocron: job not found") |
| 20 | + ErrJobRunNowFailed = errors.New("gocron: Job: RunNow: scheduler unreachable") |
| 21 | + ErrMonthlyJobDays = errors.New("gocron: MonthlyJob: daysOfTheMonth must be between 31 and -31 inclusive, and not 0") |
| 22 | + ErrMonthlyJobAtTimeNil = errors.New("gocron: MonthlyJob: atTime within atTimes must not be nil") |
| 23 | + ErrMonthlyJobAtTimesNil = errors.New("gocron: MonthlyJob: atTimes must not be nil") |
| 24 | + ErrMonthlyJobDaysNil = errors.New("gocron: MonthlyJob: daysOfTheMonth must not be nil") |
| 25 | + ErrMonthlyJobHours = errors.New("gocron: MonthlyJob: atTimes hours must be between 0 and 23 inclusive") |
| 26 | + ErrMonthlyJobZeroInterval = errors.New("gocron: MonthlyJob: interval must be greater than 0") |
| 27 | + ErrMonthlyJobMinutesSeconds = errors.New("gocron: MonthlyJob: atTimes minutes and seconds must be between 0 and 59 inclusive") |
| 28 | + ErrNewJobTaskNil = errors.New("gocron: NewJob: Task must not be nil") |
| 29 | + ErrNewJobTaskNotFunc = errors.New("gocron: NewJob: Task.Function must be of kind reflect.Func") |
| 30 | + ErrNewJobWrongNumberOfParameters = errors.New("gocron: NewJob: Number of provided parameters does not match expected") |
| 31 | + ErrNewJobWrongTypeOfParameters = errors.New("gocron: NewJob: Type of provided parameters does not match expected") |
| 32 | + ErrOneTimeJobStartDateTimePast = errors.New("gocron: OneTimeJob: start must not be in the past") |
| 33 | + ErrStopExecutorTimedOut = errors.New("gocron: timed out waiting for executor to stop") |
| 34 | + ErrStopJobsTimedOut = errors.New("gocron: timed out waiting for jobs to finish") |
| 35 | + ErrStopSchedulerTimedOut = errors.New("gocron: timed out waiting for scheduler to stop") |
| 36 | + ErrWeeklyJobAtTimeNil = errors.New("gocron: WeeklyJob: atTime within atTimes must not be nil") |
| 37 | + ErrWeeklyJobAtTimesNil = errors.New("gocron: WeeklyJob: atTimes must not be nil") |
| 38 | + ErrWeeklyJobDaysOfTheWeekNil = errors.New("gocron: WeeklyJob: daysOfTheWeek must not be nil") |
| 39 | + ErrWeeklyJobHours = errors.New("gocron: WeeklyJob: atTimes hours must be between 0 and 23 inclusive") |
| 40 | + ErrWeeklyJobZeroInterval = errors.New("gocron: WeeklyJob: interval must be greater than 0") |
| 41 | + ErrWeeklyJobMinutesSeconds = errors.New("gocron: WeeklyJob: atTimes minutes and seconds must be between 0 and 59 inclusive") |
| 42 | + ErrPanicRecovered = errors.New("gocron: panic recovered") |
| 43 | + ErrWithClockNil = errors.New("gocron: WithClock: clock must not be nil") |
| 44 | + ErrWithContextNil = errors.New("gocron: WithContext: context must not be nil") |
| 45 | + ErrWithDistributedElectorNil = errors.New("gocron: WithDistributedElector: elector must not be nil") |
| 46 | + ErrWithDistributedLockerNil = errors.New("gocron: WithDistributedLocker: locker must not be nil") |
| 47 | + ErrWithDistributedJobLockerNil = errors.New("gocron: WithDistributedJobLocker: locker must not be nil") |
| 48 | + ErrWithIdentifierNil = errors.New("gocron: WithIdentifier: identifier must not be nil") |
| 49 | + ErrWithLimitConcurrentJobsZero = errors.New("gocron: WithLimitConcurrentJobs: limit must be greater than 0") |
| 50 | + ErrWithLocationNil = errors.New("gocron: WithLocation: location must not be nil") |
| 51 | + ErrWithLoggerNil = errors.New("gocron: WithLogger: logger must not be nil") |
| 52 | + ErrWithMonitorNil = errors.New("gocron: WithMonitor: monitor must not be nil") |
| 53 | + ErrWithNameEmpty = errors.New("gocron: WithName: name must not be empty") |
| 54 | + ErrWithStartDateTimePast = errors.New("gocron: WithStartDateTime: start must not be in the past") |
| 55 | + ErrWithStopDateTimePast = errors.New("gocron: WithStopDateTime: end must not be in the past") |
| 56 | + ErrStartTimeLaterThanEndTime = errors.New("gocron: WithStartDateTime: start must not be later than end") |
| 57 | + ErrStopTimeEarlierThanStartTime = errors.New("gocron: WithStopDateTime: end must not be earlier than start") |
| 58 | + ErrWithStopTimeoutZeroOrNegative = errors.New("gocron: WithStopTimeout: timeout must be greater than 0") |
57 | 59 | )
|
58 | 60 |
|
59 | 61 | // internal errors
|
60 | 62 | var (
|
61 |
| - errAtTimeNil = fmt.Errorf("errAtTimeNil") |
62 |
| - errAtTimesNil = fmt.Errorf("errAtTimesNil") |
63 |
| - errAtTimeHours = fmt.Errorf("errAtTimeHours") |
64 |
| - errAtTimeMinSec = fmt.Errorf("errAtTimeMinSec") |
| 63 | + errAtTimeNil = errors.New("errAtTimeNil") |
| 64 | + errAtTimesNil = errors.New("errAtTimesNil") |
| 65 | + errAtTimeHours = errors.New("errAtTimeHours") |
| 66 | + errAtTimeMinSec = errors.New("errAtTimeMinSec") |
65 | 67 | )
|
0 commit comments