Update exception.wrap_exception so that all exceptions (not just Error
and NovaException types) get logged correctly.
This commit is contained in:
@@ -74,14 +74,13 @@ class WrapExceptionTestCase(test.TestCase):
|
||||
|
||||
def test_wrap_exception_throws_exception(self):
|
||||
wrapped = exception.wrap_exception()
|
||||
# Note that Exception is converted to Error ...
|
||||
self.assertRaises(exception.Error, wrapped(bad_function_exception))
|
||||
self.assertRaises(Exception, wrapped(bad_function_exception))
|
||||
|
||||
def test_wrap_exception_with_notifier(self):
|
||||
notifier = FakeNotifier()
|
||||
wrapped = exception.wrap_exception(notifier, "publisher", "event",
|
||||
"level")
|
||||
self.assertRaises(exception.Error, wrapped(bad_function_exception))
|
||||
self.assertRaises(Exception, wrapped(bad_function_exception))
|
||||
self.assertEquals(notifier.provided_publisher, "publisher")
|
||||
self.assertEquals(notifier.provided_event, "event")
|
||||
self.assertEquals(notifier.provided_priority, "level")
|
||||
@@ -91,7 +90,7 @@ class WrapExceptionTestCase(test.TestCase):
|
||||
def test_wrap_exception_with_notifier_defaults(self):
|
||||
notifier = FakeNotifier()
|
||||
wrapped = exception.wrap_exception(notifier)
|
||||
self.assertRaises(exception.Error, wrapped(bad_function_exception))
|
||||
self.assertRaises(Exception, wrapped(bad_function_exception))
|
||||
self.assertEquals(notifier.provided_publisher, None)
|
||||
self.assertEquals(notifier.provided_event, "bad_function_exception")
|
||||
self.assertEquals(notifier.provided_priority, notifier.ERROR)
|
||||
|
||||
Reference in New Issue
Block a user