Edits history of script submission #9020 for ' Global / workspace error handler template (windmill)'

  • bun
    One script reply has been approved by the moderators
    Ap­pro­ved
    // Global / workspace error handler template
    
    export async function main(
      path: string, // The path of the script or flow that errored
      email: string, // The email of the user who ran the script or flow that errored
      error: object, // The error details
      job_id: string, // The job id
      is_flow: boolean, // Whether the error comes from a flow
      workspace_id: string // The workspace id of the failed script or flow
    ) {
      const run_type = is_flow ? "flow" : "script";
      console.log(
        `An error occured with ${run_type} ${path} run by ${email} in workspace ${workspace_id}`
      );
      console.log(error);
      return error;
    }

    Submitted by hugo697 618 days ago