Retry{Again,Timeout}: explain reraising
authorGuido Trotter <ultrotter@google.com>
Fri, 7 May 2010 15:02:36 +0000 (17:02 +0200)
committerGuido Trotter <ultrotter@google.com>
Mon, 10 May 2010 08:56:26 +0000 (09:56 +0100)
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

lib/utils.py

index ce112c9..6d2cd0f 100644 (file)
@@ -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.
+
   """