[coretasks] Fix overly broad try-except.

Related to issue #288.