ipykernel icon indicating copy to clipboard operation
ipykernel copied to clipboard

No 'error' message type sent for cell execution errors

Open lumberbot-app[bot] opened this issue 3 years ago • 3 comments

According to the Messaging documentation there should be a message type 'error' sent on the iopub channel when cell execution errors occur. It is meant to mimic the execute_reply shell message but without certain fields. However I am only see a stream message with the error text and a display_data message with the jupyter widget stack trace when there are cell execution errors. Has the 'error' message type been discontinued?

`{'header': {'msg_id': '4c8a15ae-612f3609103b1ff405b9785a_34_9', 'msg_type': 'stream', 'username': 'datalab', 'session': '4c8a15ae-612f3609103b1ff405b9785a', 'date': datetime.datetime(2022, 4, 22, 16, 33, 22, 223826, tzinfo=tzlocal()), 'version': '5.3'}, 'msg_id': '4c8a15ae-612f3609103b1ff405b9785a_34_9', 'msg_type': 'stream', 'metadata': {}, 'content': {'name': 'stdout', 'text': "\n\x1b[0;31mNameError: \x1b[0mname 'b' is not defined\n\nError found at \x1b[0;36mline 5\x1b[0m in \x1b[0;32mfile /tmp/ipykernel_34/2478479356.py\x1b[0m.\n"}, 'buffers': []}

{'header': {'msg_id': '4c8a15ae-612f3609103b1ff405b9785a_34_10', 'msg_type': 'display_data', 'username': 'datalab', 'session': '4c8a15ae-612f3609103b1ff405b9785a', 'date': datetime.datetime(2022, 4, 22, 16, 33, 22, 226738, tzinfo=tzlocal()), 'version': '5.3'}, 'msg_id': '4c8a15ae-612f3609103b1ff405b9785a_34_10', 'msg_type': 'display_data', 'metadata': {}, 'content': {'data': {'text/plain': "Button(description='Click to show stack trace', layout=Layout(height='auto', width='auto'), style=ButtonStyle(…", 'application/vnd.jupyter.widget-view+json': {'version_major': 2, 'version_minor': 0, 'model_id': 'd1ef6870d5a24e1d8b503b9227d2421e'}}, 'metadata': {}, 'transient': {}}, 'buffers': []}`

ipykernel 6.0.1 ipython 7.31.1 ipython-genutils 0.2.0 jupyter-client 7.0.6 jupyter-core 4.8.1 jupyter-packaging 0.10.4 jupyter-server 1.15.5 jupyterlab 3.3.2 jupyterlab-pygments 0.1.2 jupyterlab-server 2.10.3 jupyterlab-widgets 1.0.2 nbclassic 0.3.2 nbclient 0.5.4 nbconvert 6.2.0 nbformat 5.2.0 notebook 6.4.10


Originally opened as jupyter/jupyter_client#776 by @matthewgasbarro, migration requested by @blink1073

lumberbot-app[bot] avatar Apr 27 '22 15:04 lumberbot-app[bot]

@blink1073 commented: Thanks for the report @matthewgasbarro, this issue is arising in ipykernel itself, so I am going to first migrate the issue there.

lumberbot-app[bot] avatar Apr 27 '22 15:04 lumberbot-app[bot]

We should be emitting an error message in do_execute on error, the same way we do in do_apply.

blink1073 avatar Apr 27 '22 15:04 blink1073

@matthewgasbarro, would you like to make a PR?

blink1073 avatar Apr 27 '22 15:04 blink1073