diff --git a/runipy/notebook_runner.py b/runipy/notebook_runner.py
index <HASH>..<HASH> 100644
--- a/runipy/notebook_runner.py
+++ b/runipy/notebook_runner.py
@@ -75,7 +75,9 @@ class NotebookRunner(object):
         reply = self.shell.get_msg()
         status = reply['content']['status']
         if status == 'error':
-            logging.info('Cell raised uncaught exception: \n%s', '\n'.join(reply['content']['traceback']))
+            traceback_text = 'Cell raised uncaught exception: \n' + \
+                '\n'.join(reply['content']['traceback'])
+            logging.info(traceback_text)
         else:
             logging.info('Cell returned')
 
@@ -127,7 +129,7 @@ class NotebookRunner(object):
         cell['outputs'] = outs
 
         if status == 'error':
-            raise NotebookError()
+            raise NotebookError(traceback_text)
 
 
     def iter_code_cells(self):
Avoid mangling traceback ANSI formatting.

This also attaches the traceback text to the NotebookError that gets raised if
exceptions are allowed.