Thread
#prefect-community
    t

    Tsang Yong

    2 years ago
    Is there an example on how to catch bad shelltask in prefect? looking at the docs page it’s not clear to me how to catch these other a raise reference prefect.engine.signals.FAIL
    Jeremiah

    Jeremiah

    2 years ago
    Hi @Tsang Yong — the
    ShellTask
    will enter a failed state if the command returns anything but a
    0
    exit code
    Do you want to make that optional?
    t

    Tsang Yong

    2 years ago
    Task state failed that makes sense. Can I grab the bad output in that case?
    Jeremiah

    Jeremiah

    2 years ago
    The
    result
    of the Failed state does contain the last line of output. So if you made a task downstream of the
    ShellTask
    and gave it an
    any_failed
    trigger (so it runs even if the ShellTask fails), you should be able to receive that line as the input data. But maybe we can make this even easier