I humbly emit a wish that in future releases the Bokeh server would be a bit more vocal on runtime exceptions, as that would make debugging easier.
We absolutely, already do provide as much information as possible, wherever it is possible. E.g. if you jsut run bokeh serve --show app.py
on a script that contains 1/0
and nothing else you will see the full stack trace in the server console log:
2021-06-08 17:30:50,287 Error running application handler <bokeh.application.handlers.script.ScriptHandler object at 0x7fd31837c4c0>: division by zero
File "app.py", line 1, in <module>:
1/0 Traceback (most recent call last):
File "/Users/bryan/anaconda/envs/bk-232/lib/python3.9/site-packages/bokeh/application/handlers/code_runner.py", line 197, in run
exec(self._code, module.__dict__)
File "/Users/bryan/tmp/app.py", line 1, in <module>
1/0
ZeroDivisionError: division by zero
And the same is true of any exception in a callback (including in scripts that use the Server
API programmatically):
ERROR:bokeh.server.protocol_handler:error handling message
message: Message 'PATCH-DOC' content: {'events': [{'kind': 'ModelChanged', 'model': {'id': '1041'}, 'attr': 'value', 'new': 1}], 'references': []}
error: ZeroDivisionError('division by zero')
Traceback (most recent call last):
File "/Users/bryan/anaconda/envs/bk-232/lib/python3.9/site-packages/bokeh/server/protocol_handler.py", line 90, in handle
work = await handler(message, connection)
..........
File "/Users/bryan/work/bokeh/examples/howto/server_embed/standalone_embed.py", line 18, in callback
1/0
In general the Bokeh server console log will have this information. But not every situation is equal, e.g. things may not be easily viewable or accessible in notebook settings. I would always advise dev/testing outside the notebook since the notebook always adds complexity and levels of distance/abstraction.
If you saying you have seen an exception in app code that did not result in a stack trace being logged in the console, then we would need a Minimal Reproducible Example to investigate.