projects
/
tahoe-lafs
/
tahoe-lafs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
699510c
)
rrefutil: add trap_deafref utility, to make the callRemote-plus-ignore-DeadReferenceE...
author
Brian Warner
<warner@lothar.com>
Tue, 23 Jun 2009 02:08:26 +0000
(19:08 -0700)
committer
Brian Warner
<warner@lothar.com>
Tue, 23 Jun 2009 02:08:26 +0000
(19:08 -0700)
src/allmydata/util/rrefutil.py
patch
|
blob
|
history
diff --git
a/src/allmydata/util/rrefutil.py
b/src/allmydata/util/rrefutil.py
index 097e732a1d04a97524777c66133a21d58630236f..8d2d6c2a562d38904aa0a9d3a899ead45d0c8566 100644
(file)
--- a/
src/allmydata/util/rrefutil.py
+++ b/
src/allmydata/util/rrefutil.py
@@
-1,5
+1,5
@@
-from foolscap.api import Violation, RemoteException
+from foolscap.api import Violation, RemoteException
, DeadReferenceError
def add_version_to_remote_reference(rref, default):
"""I try to add a .version attribute to the given RemoteReference. I call
@@
-17,3
+17,10
@@
def add_version_to_remote_reference(rref, default):
d.addCallbacks(_got_version, _no_get_version)
return d
+def trap_and_discard(f, *errorTypes):
+ f.trap(*errorTypes)
+ pass
+
+def trap_deadref(f):
+ f.trap(DeadReferenceError)
+ pass