adjust an error message

This commit is contained in:
mightypanders 2022-04-23 21:29:35 +02:00
parent 6ff3e68921
commit 99386b1662

View File

@ -1,3 +1,4 @@
import { CustomError, errorCodes } from "../interfaces";
import { scheduleNames, supportedSchedule } from "../types/scheduledEventTypes"; import { scheduleNames, supportedSchedule } from "../types/scheduledEventTypes";
export function findInScheduleTypes(inputString: string): supportedSchedule { export function findInScheduleTypes(inputString: string): supportedSchedule {
@ -7,7 +8,7 @@ export function findInScheduleTypes(inputString: string): supportedSchedule {
// `sheepName` comes from the list of `sheepNames` so the compiler is happy. // `sheepName` comes from the list of `sheepNames` so the compiler is happy.
return scheduleName; return scheduleName;
} }
throw new Error('That is not a schedule name.'); throw new CustomError('That is not a schedule name.', errorCodes.schedule_not_supported);
} }