Catch all exceptions in wait_with_retry.