Task: Store state for exceptions occurring outside of task body.  Closes #1582