Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

Exception stack traces missing when simulation Q# from python notebooks #699

@adrianleh

Description

@adrianleh

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-KernelIssue relates to the IQ# kernel.Kind-EnhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions