Skip to content

Commit

Permalink
Improve diagnostic message when QIR codegen fails due to a runtime er…
Browse files Browse the repository at this point in the history
…ror (#809)

This change includes the error string from runtime errors in the pop-up
error dialog when QIR generation fails.

<img alt="image"
src="https://github.com/microsoft/qsharp/assets/12157751/4784f746-01ef-45cb-acdb-19939a0cbc18">


Closes #747
  • Loading branch information
sezna authored Oct 24, 2023
1 parent a153981 commit 70b107c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vscode/src/qirGeneration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export async function getQirForActiveWindow(): Promise<string> {
} catch (e: any) {
log.error("Codegen error. ", e.toString());
throw new QirGenerationError(
"Code generation failed. Please ensure the code is compatible with the QIR base profile " +
`Code generation failed due to error: "${e.toString()}". Please ensure the code is compatible with the QIR base profile ` +
"by setting the target QIR profile to 'base' and fixing any errors."
);
} finally {
Expand Down

0 comments on commit 70b107c

Please sign in to comment.