exception.wrap_exception munges exceptions which aren't instances of Error or NovaException. This can lead to really confusing stack traces like:
2011-09-15 12:37:02,599 ERROR nova.rpc [-] Exception during message handling
(nova.rpc): TRACE: Traceback (most recent call last):
(nova.rpc): TRACE: File "/usr/lib/pymodules/python2.6/nova/rpc/impl_kombu.py", line 620, in _process_data
(nova.rpc): TRACE: rval = node_func(context=ctxt, **node_args)
(nova.rpc): TRACE: File "/usr/lib/pymodules/python2.6/nova/exception.py", line 129, in wrapped
(nova.rpc): TRACE: raise Error(str(e))
(nova.rpc): TRACE: Error: list index out of range
(nova.rpc): TRACE:
Good luck finding that one!
We have code in place to capture the exception stack trace before utils.to_primative munges everything for notification. Looks like we only use this code if the original exception inherits from Error or NovaException. We should robustly log all exceptions!