Don't Repeat exception handling
remove more repetition of error path
Merge pull request #408 from mk270/refactor-task-import

Refactor task import