Moving exception raising code to the tasks.cancel from the dispatch controller