added handling in case tasks used by continuations throw exceptions
(cannot handle case where continuation callback throws)