Repository navigation
fix: include ANTLR diagnostic in loads() ValidationError - #452
tonycoder-hub wants to merge 1 commit into
Conversation
Argus reviewAuto-review is off for this repo. Tick the box below to run a review on this PR.
Estimated cost
Tip: you can also comment |
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
cfc7dd9 to
e2719b4
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
openqasm3 often raises QASM3ParsingError with an empty message while writing the real ANTLR diagnostic to stderr. Capture stderr during parse so ValidationError carries a useful reason for callers. Signed-off-by: Tony Coder <407243179@qq.com>
05949db to
69414d3
Compare
Summary of changes
openqasm3.parseoften raisesQASM3ParsingErrorwith an empty message while printing the ANTLR diagnostic to stderr.pyqasm.loads()then producedValidationError: Failed to parse OpenQASM string:with no reason for callers.Capture stderr during parse and prefer that text when the exception message is empty, so the ValidationError includes the diagnostic (e.g.
line 3:10 no viable alternative…).Fixes #436