Skip to content
Snippets Groups Projects
Commit 06358e32 authored by Rhys Arkins's avatar Rhys Arkins Committed by GitHub
Browse files

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

* fix: print schedule text along with error message

* update test
parent 26bafe8d
No related branches found
No related tags found
No related merge requests found
...@@ -29,11 +29,11 @@ function hasValidSchedule(schedule) { ...@@ -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
......
...@@ -8,7 +8,7 @@ Array [ ...@@ -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",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment