fix: print schedule text along with error message (#679)

* fix: print schedule text along with error message

* update test
This commit is contained in:
Rhys Arkins 2017-08-15 09:13:25 +02:00 committed by GitHub
parent 26bafe8d7a
commit 06358e32c7
2 changed files with 3 additions and 3 deletions

View file

@ -29,11 +29,11 @@ function hasValidSchedule(schedule) {
return true; return true;
} }
if (parsedSchedule.schedules.some(s => s.m)) { if (parsedSchedule.schedules.some(s => s.m)) {
message = 'Schedules should not specify minutes'; message = `Schedule "${scheduleText}" should not specify minutes`;
return true; return true;
} }
if (!parsedSchedule.schedules.some(s => s.d || s.t_a || s.t_b)) { if (!parsedSchedule.schedules.some(s => s.d || s.t_a || s.t_b)) {
message = 'Schedule has no days of week or time of day'; message = `Schedule "${scheduleText}" has no days of week or time of day`;
return true; return true;
} }
// It must be OK // It must be OK

View file

@ -8,7 +8,7 @@ Array [
}, },
Object { Object {
"depName": "Configuration Error", "depName": "Configuration Error",
"message": "Invalid schedule: \`Schedules should not specify minutes\`", "message": "Invalid schedule: \`Schedule \\"every 15 mins every weekday\\" should not specify minutes\`",
}, },
Object { Object {
"depName": "Configuration Error", "depName": "Configuration Error",