Generate exception if the timeout has been reached