1
2
3
4
5
6
7
8
9 from exceptions import ImportError, Exception
10 from zope.dottedname.resolve import resolve
11
12
14 """Root of all Zentinel Exceptions"""
15 pass
16
17
19 """When walking a path something along the way wasn't found."""
20 pass
21
22
24 """
25 Resolves a twisted.python.failure into the remote exception type that was
26 initially raised.
27 """
28 exctype = failure.type
29 if isinstance(exctype, basestring):
30 try:
31 exctype = resolve(failure.type)
32 except ImportError:
33 exctype = Exception
34 return exctype(failure.value, failure.tb)
35