typo
fixed broken check of task failure

Replaced
        when_failed:$result
with
        when:result|failed