Added exception handling to task class
Revert "Added exception handling to task class"

This reverts commit 1e82daac7ffdb19b4dcc210231190696b25ea8ac.
Added exception handling to task.java