jupyter-sphinx icon indicating copy to clipboard operation
jupyter-sphinx copied to clipboard

Show file location of errors in cells

Open SeanDS opened this issue 4 years ago • 2 comments

If there is an uncaught exception in a cell, there appears to be no information as to the real file line location where the error occurred:

Extension error:
Cell raised uncaught exception:
---------------------------------------------------------------------------
Exception                                 Traceback (most recent call last)
<ipython-input-14-703b9bbf0f60> in <module>
      9 )
     10 """)
---> 11 sol = model.run()
     12 print(sol['xaxis1']['P'])
     13 print(sol['xaxis2']['P'])

[stack trace from imported library code]

Exception: The property <l1.P=1 @ 0x7f5c045fe2c0> cannot be changed

All I see for the source of the cell that had the error is <ipython-input-14-703b9bbf0f60> in <module>. I can search my project for the code shown in the error, but this is not ideal. Can Jupyter-Sphinx figure out the real file and line number corresponding to the error location and report this when an error occurs?

SeanDS avatar Apr 20 '21 07:04 SeanDS

Sounds good, we should inspect how nbclient reports errors and show more details.

akhmerov avatar Apr 20 '21 10:04 akhmerov

before a solution is available, perhaps running python -msphinx -M html . _build -vv with the -vv option for verbose output might help identify the cause

caenrigen avatar May 10 '21 10:05 caenrigen