From 40bc67e1cbcb66fa82f4c42d5d5d2069e7b6223c Mon Sep 17 00:00:00 2001 From: Guido Trotter <ultrotter@google.com> Date: Fri, 7 May 2010 17:02:36 +0200 Subject: [PATCH] Retry{Again,Timeout}: explain reraising Signed-off-by: Guido Trotter <ultrotter@google.com> Reviewed-by: Iustin Pop <iustin@google.com> --- lib/utils.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/utils.py b/lib/utils.py index ce112c914..6d2cd0fee 100644 --- a/lib/utils.py +++ b/lib/utils.py @@ -2498,6 +2498,10 @@ def ReadWatcherPauseFile(filename, now=None, remove_after=3600): class RetryTimeout(Exception): """Retry loop timed out. + Any arguments which was passed by the retried function to RetryAgain will be + preserved in RetryTimeout, if it is raised. If such argument was an exception + the RaiseInner helper method will reraise it. + """ def RaiseInner(self): if self.args and isinstance(self.args[0], Exception): @@ -2509,6 +2513,10 @@ class RetryTimeout(Exception): class RetryAgain(Exception): """Retry again. + Any arguments passed to RetryAgain will be preserved, if a timeout occurs, as + arguments to RetryTimeout. If an exception is passed, the RaiseInner() method + of the RetryTimeout() method can be used to reraise it. + """ -- GitLab