Skip to content

Commit 9b39337

Browse files
committed
Add show_tracebacks trait
1 parent da9bbe7 commit 9b39337

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

voila/app.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class Voila(Application):
7676
examples = 'voila example.ipynb --port 8888'
7777

7878
flags = {
79-
'debug': ({'Voila': {'log_level': logging.DEBUG}}, _("Set the log level to logging.DEBUG")),
79+
'debug': ({'Voila': {'log_level': logging.DEBUG, 'show_tracebacks': True}}, _("Set the log level to logging.DEBUG")),
8080
'no-browser': ({'Voila': {'open_browser': False}}, _('Don\'t open the notebook in a browser after startup.'))
8181
}
8282

@@ -186,6 +186,10 @@ class Voila(Application):
186186
)
187187
)
188188

189+
show_tracebacks = Bool(False, config=True, help=_(
190+
'Whether to send tracebacks to clients on exceptions.'
191+
))
192+
189193
port_retries = Integer(50, config=True,
190194
help=_("The number of additional ports to try if the specified port is not available.")
191195
)

voila/execute.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def strip_code_cell_warnings(cell):
3232

3333
def should_strip_error(config):
3434
"""Return True if errors should be stripped from the Notebook, False otherwise, depending on the current config."""
35-
return 'Voila' not in config or 'log_level' not in config['Voila'] or config['Voila']['log_level'] != logging.DEBUG
35+
return 'Voila' not in config or config['Voila'].get('show_tracebacks', False)
3636

3737

3838
class VoilaExecutor(NotebookClient):

0 commit comments

Comments
 (0)