Attaches error to task upon failure