Changeset 2170
- Timestamp:
- 03/30/09 12:08:36
- Files:
-
- branches/python3/cherrypy/process/wspbus.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/python3/cherrypy/process/wspbus.py
r2169 r2170 74 74 75 75 76 class ChannelFailures(Exception): 77 delimiter = '\n' 78 79 def __init__(self): 80 self._exceptions = list() 81 82 def handle_exception(self): 83 self._exceptions.append(sys.exc_info()) 84 85 def get_instances(self): 86 return [instance for cls, instance, traceback in self._exceptions] 87 88 def __str__(self): 89 exception_strings = map(str, self.get_instances()) 90 return self.delimiter.join(exception_strings) 91 92 def __bool__(self): 93 return bool(self._exceptions) 94 76 95 # Use a flag to indicate the state of the bus. 77 96 class _StateEnum(object): … … 137 156 return [] 138 157 139 exc = None158 exc = ChannelFailures() 140 159 output = [] 141 160 … … 155 174 raise 156 175 except: 157 exc = sys.exc_info()[1]176 exc.handle_exception() 158 177 if channel == 'log': 159 178 # Assume any further messages to 'log' will fail. … … 163 182 level=40, traceback=True) 164 183 if exc: 165 raise 184 raise exc 166 185 return output 167 186

