chore(task): throw exception if the thread was terminated
chore(task): throw exception if the thread was terminated