// Schedule error handler template
export async function main(
path: string, // The path of the script or flow that errored
is_flow: boolean, // Whether the runnable is a flow
schedule_path: string, // The path of the schedule
error: object, // The error details
started_at: string, // The start datetime of the latest job that failed
failed_times: number // Minimum number of times the schedule failed before calling the error handler
) {
console.log(
`Schedule ${schedule_path} failed ${
failed_times > 1 ? failed_times + " times in a row" : ""
}\n${is_flow ? "Flow" : "Script"}: ${path}`
);
console.log(`Last failure at ${started_at}:`, error);
return error;
}
Submitted by hugo697 83 days ago