Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add error handling for stderr in interpret function #2723

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Stevengre
Copy link
Contributor

  • Raise an exception if there is any output in stderr after processing the command.
  • This change ensures that errors are caught and handled appropriately during interpretation.

- Raise an exception if there is any output in stderr after processing the command.
- This change ensures that errors are caught and handled appropriately during interpretation.
@@ -21,6 +21,9 @@ def interpret(gst_data: Any, schedule: str, mode: str, chainid: int, usegas: boo
if check:
proc_res.check_returncode()

if len(proc_res.stderr) > 0:
raise Exception(proc_res.stderr)
Copy link
Contributor

@tothtamas28 tothtamas28 Mar 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems a bit convoluted. If check is True, then this code I think is not reachable. Otherwise, you do not want an exception to be raised.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The call to run_process_2 in _interpret should probably be replaced by llvm_interpret from pyk.ktool.krun.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants