set last error if job fails

Change-Id: I8acb0c95681e36cd42b970578ca3ab03c99aac0b
Merge "set last error if job fails"