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