// Schedule error handler template
export async function main(
workspace_id: string, // The ID of the workspace that the schedule belongs to
job_id: string, // The UUID of the job that errored
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 failed job started at ${started_at}:`, error);
return error;
}
Submitted by hugo697 21 days ago
// 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 322 days ago