If the user has a large notebook, and they've made some coding error that causes either a SyntaxError or a runtime error and traceback, it can be very hard to tell what's happened — whether an error has occurred, and if so where.
I currently work around this by searching for strings like SyntaxError and most recent call in the page. But it seems that it would be much saner to jump the user to the place where the error happened, and highlight things in red.
(There are probably fancy things the notebook could do, like highlighting the exact line that errored, and displaying the traceback in the huge amount of blank margin space that's typical on 16:9 monitors... but it would be a great start to put the cursor in the right place).
This is definitely a good idea, but it's not trivial to get it right.
It doesn't seem that hard to get the basic case right! This snippet seems to correctly print the location of the error on the Python side:
import re
import sys
try:
import nosuchthing
except:
exc_type, value, tb = sys.exc_info()
line = tb.tb_lineno
context = tb.tb_frame and tb.tb_frame.f_code and tb.tb_frame.f_code.co_filename
if context:
match = re.match(r"<ipython-input-([0-9]+)-", context)
input_id = match and match.group(0)
print "Input:", input_id, "line", line
raise

The CSS selector path for the line in question would be something like
div.input_prompt (ideally that div should get the number added to it as an id, currently I see <div class="prompt input_prompt">In [1182]:</div>, so you'd need to walk them to find the right one at present)div.CodeMirror-code pre and you have a reference to the line for highlighting / jumping.@takluyver am I missing anything important there? If not, I might be tempted to make a quick PR for this, though I'd appreciate working with someone who's familiar with Jupyter Notebook's JS front end to do this faster/better.
I think the tricky bits are:
It's all doable if you're keen to work on it, but it's a bit more than a 'quick PR' - it's going to require changes in at least a couple of repositories (this one and ipykernel).
It's 2019 and would love to see if technology has matured for this feature for Jupyter notebook or lab?
Most helpful comment
It's 2019 and would love to see if technology has matured for this feature for Jupyter notebook or lab?