dbader / schedule

Python job scheduling for humans.
https://schedule.readthedocs.io/
MIT License
11.73k stars 960 forks source link

Improve error message when scheduling job every n weekday #433

Closed SijmenHuizenga closed 3 years ago

SijmenHuizenga commented 3 years ago

The following code:

schedule.every(2).friday.do(foo)

Results in the following error:

schedule.IntervalError: Use fridays instead of friday

The error message makes one believe that the code should be updated to:

schedule.every(2).fridays.do(foo)

:point_up: is invalid code. fridays() is not supported by design.

Let's update the error message to reflect this.

sosolidkk commented 3 years ago

Hello, i'm looking forward to submit my first contribution. Can i get this one? What would be a proper error message? Or should i just remove the error message?

SijmenHuizenga commented 3 years ago

Hi @sosolidkk Yes, you can go ahead! I think the best way to do this is to change the error message in something more descriptive. Suggestions are welcome :wink: Maybe something along the lines of scheduling jobs every n weeks is not supported?

sosolidkk commented 3 years ago

Could be something like For week days use only the interval equal to 1 since it's the only supported value? And we could to the same to the weekends since it contains the same message.