Commit 1140036f authored by Timothy J. Baek's avatar Timothy J. Baek
Browse files

feat: python error handling

parent 58a13aec
......@@ -47,7 +47,11 @@ original_stdout = sys.stdout
# Replace the standard output with the StringIO object
sys.stdout = output_capture
${text}
try:
${text}
except Exception as e:
# Capture any errors and write them to the output capture
print(f"Error: {e}", file=output_capture)
# Restore the original standard output
sys.stdout = original_stdout
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment