gocron/errors.go

72 lines
5.8 KiB
Go

package gocron
import (
"errors"
)
// Public error definitions
var (
ErrCronJobInvalid = errors.New("gocron: CronJob: invalid crontab")
ErrCronJobParse = errors.New("gocron: CronJob: crontab parse failure")
ErrDailyJobAtTimeNil = errors.New("gocron: DailyJob: atTime within atTimes must not be nil")
ErrDailyJobAtTimesNil = errors.New("gocron: DailyJob: atTimes must not be nil")
ErrDailyJobHours = errors.New("gocron: DailyJob: atTimes hours must be between 0 and 23 inclusive")
ErrDailyJobZeroInterval = errors.New("gocron: DailyJob: interval must be greater than 0")
ErrDailyJobMinutesSeconds = errors.New("gocron: DailyJob: atTimes minutes and seconds must be between 0 and 59 inclusive")
ErrDurationJobIntervalZero = errors.New("gocron: DurationJob: time interval is 0")
ErrDurationJobIntervalNegative = errors.New("gocron: DurationJob: time interval must be greater than 0")
ErrDurationRandomJobPositive = errors.New("gocron: DurationRandomJob: minimum and maximum durations must be greater than 0")
ErrDurationRandomJobMinMax = errors.New("gocron: DurationRandomJob: minimum duration must be less than maximum duration")
ErrEventListenerFuncNil = errors.New("gocron: eventListenerFunc must not be nil")
ErrJobNotFound = errors.New("gocron: job not found")
ErrJobRunNowFailed = errors.New("gocron: Job: RunNow: scheduler unreachable")
ErrMonthlyJobDays = errors.New("gocron: MonthlyJob: daysOfTheMonth must be between 31 and -31 inclusive, and not 0")
ErrMonthlyJobAtTimeNil = errors.New("gocron: MonthlyJob: atTime within atTimes must not be nil")
ErrMonthlyJobAtTimesNil = errors.New("gocron: MonthlyJob: atTimes must not be nil")
ErrMonthlyJobDaysNil = errors.New("gocron: MonthlyJob: daysOfTheMonth must not be nil")
ErrMonthlyJobHours = errors.New("gocron: MonthlyJob: atTimes hours must be between 0 and 23 inclusive")
ErrMonthlyJobZeroInterval = errors.New("gocron: MonthlyJob: interval must be greater than 0")
ErrMonthlyJobMinutesSeconds = errors.New("gocron: MonthlyJob: atTimes minutes and seconds must be between 0 and 59 inclusive")
ErrNewJobTaskNil = errors.New("gocron: NewJob: Task must not be nil")
ErrNewJobTaskNotFunc = errors.New("gocron: NewJob: Task.Function must be of kind reflect.Func")
ErrNewJobWrongNumberOfParameters = errors.New("gocron: NewJob: Number of provided parameters does not match expected")
ErrNewJobWrongTypeOfParameters = errors.New("gocron: NewJob: Type of provided parameters does not match expected")
ErrOneTimeJobStartDateTimePast = errors.New("gocron: OneTimeJob: start must not be in the past")
ErrStopExecutorTimedOut = errors.New("gocron: timed out waiting for executor to stop")
ErrStopJobsTimedOut = errors.New("gocron: timed out waiting for jobs to finish")
ErrStopSchedulerTimedOut = errors.New("gocron: timed out waiting for scheduler to stop")
ErrWeeklyJobAtTimeNil = errors.New("gocron: WeeklyJob: atTime within atTimes must not be nil")
ErrWeeklyJobAtTimesNil = errors.New("gocron: WeeklyJob: atTimes must not be nil")
ErrWeeklyJobDaysOfTheWeekNil = errors.New("gocron: WeeklyJob: daysOfTheWeek must not be nil")
ErrWeeklyJobHours = errors.New("gocron: WeeklyJob: atTimes hours must be between 0 and 23 inclusive")
ErrWeeklyJobZeroInterval = errors.New("gocron: WeeklyJob: interval must be greater than 0")
ErrWeeklyJobMinutesSeconds = errors.New("gocron: WeeklyJob: atTimes minutes and seconds must be between 0 and 59 inclusive")
ErrPanicRecovered = errors.New("gocron: panic recovered")
ErrWithClockNil = errors.New("gocron: WithClock: clock must not be nil")
ErrWithContextNil = errors.New("gocron: WithContext: context must not be nil")
ErrWithDistributedElectorNil = errors.New("gocron: WithDistributedElector: elector must not be nil")
ErrWithDistributedLockerNil = errors.New("gocron: WithDistributedLocker: locker must not be nil")
ErrWithDistributedJobLockerNil = errors.New("gocron: WithDistributedJobLocker: locker must not be nil")
ErrWithIdentifierNil = errors.New("gocron: WithIdentifier: identifier must not be nil")
ErrWithLimitConcurrentJobsZero = errors.New("gocron: WithLimitConcurrentJobs: limit must be greater than 0")
ErrWithLocationNil = errors.New("gocron: WithLocation: location must not be nil")
ErrWithLoggerNil = errors.New("gocron: WithLogger: logger must not be nil")
ErrWithMonitorNil = errors.New("gocron: WithMonitor: monitor must not be nil")
ErrWithNameEmpty = errors.New("gocron: WithName: name must not be empty")
ErrWithStartDateTimePast = errors.New("gocron: WithStartDateTime: start must not be in the past")
ErrWithStartDateTimePastZero = errors.New("gocron: WithStartDateTime: start must not be zero")
ErrWithStopDateTimePast = errors.New("gocron: WithStopDateTime: end must not be in the past")
ErrStartTimeLaterThanEndTime = errors.New("gocron: WithStartDateTime: start must not be later than end")
ErrStopTimeEarlierThanStartTime = errors.New("gocron: WithStopDateTime: end must not be earlier than start")
ErrWithStopTimeoutZeroOrNegative = errors.New("gocron: WithStopTimeout: timeout must be greater than 0")
ErrWithSchedulerMonitorNil = errors.New("gocron: WithSchedulerMonitor: scheduler monitor cannot be nil")
)
// internal errors
var (
errAtTimeNil = errors.New("errAtTimeNil")
errAtTimesNil = errors.New("errAtTimesNil")
errAtTimeHours = errors.New("errAtTimeHours")
errAtTimeMinSec = errors.New("errAtTimeMinSec")
)