kraemer-lab / GRAPEVNE

Graphical Analytical Pipeline Development Evironment
MIT License
6 stars 3 forks source link

Notification on error #281

Closed jsbrittain closed 3 months ago

jsbrittain commented 3 months ago

Snakemake supports error handlers, and exits with a non-zero code on error. Specifically, onstart, onsuccess and onerror handlers are documented for Snakemake v7 here: https://snakemake.readthedocs.io/en/v7.0.0/snakefiles/rules.html#onstart-onsuccess-and-onerror-handlers. These are separate directives (outside of rules) which trigger when the workflow exits. They do not trigger if the workflow does not start due to, e.g. missing required files.

E.g.

rule all:
    ...

onerror:
    print("An error occured")

They should therefore be added to the workflow during construction (by grapevne), and could hook into existing scripts (such as email). Configuration would presumably be handled in the GRAPEVNE Settings pane.