iqsharp icon indicating copy to clipboard operation
iqsharp copied to clipboard

Exception stack traces missing when simulation Q# from python notebooks

Open adrianleh opened this issue 3 years ago • 0 comments

Describe the bug

When a QSharp operation, declared inside a %%qsharp cell in a python jupyter notebook, is run through a simulator from python and throws an exception the error message does not contain a stack trace but rather just the exception with its message.

To Reproduce

Run a Q# operation (declared in a %%qsharp cell) that throws an exception from a python simulator in a jupyter notebook

Expected behavior

Print the exception message and error location or stack trace of such errors to allow users to debug where the error is.

Actual behavior

The exception is shown but without a stack trace or any indication of where the exception was thrown, except for the entry point of the simulation (SolvePuzzle in the example below).

The stack trace and error location can be found in the debug console, if IQSHARP_LOG_LEVEL is set to DEBUG Example: ff1e7191-a92e-4044-9a94-5cd83d7782d1

System information

  • OS: Win 10

  • .NET Core Version: 6.0.302

  • IQ# Version: iqsharp: 0.24.210930 Jupyter Core: 1.5.0.0

  • Python Version (if applicable): 3.9.12

adrianleh avatar Jul 15 '22 21:07 adrianleh