Handle errors from setTimeout