mirror of
https://github.com/open-webui/open-webui
synced 2025-02-18 02:57:02 +00:00
feat: python error handling
This commit is contained in:
parent
58a13aec7e
commit
1140036f20
@ -47,7 +47,11 @@ original_stdout = sys.stdout
|
|||||||
# Replace the standard output with the StringIO object
|
# Replace the standard output with the StringIO object
|
||||||
sys.stdout = output_capture
|
sys.stdout = output_capture
|
||||||
|
|
||||||
|
try:
|
||||||
${text}
|
${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
|
# Restore the original standard output
|
||||||
sys.stdout = original_stdout
|
sys.stdout = original_stdout
|
||||||
|
Loading…
Reference in New Issue
Block a user