From 0cc2bd0ab4b7d1fa62d7ec3fecb95862de181cf8 Mon Sep 17 00:00:00 2001 From: jona42-ui Date: Mon, 22 Apr 2024 07:27:39 +0300 Subject: [PATCH] handle exceptions manually --- webapp/app.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/webapp/app.py b/webapp/app.py index 27ebcd1..d9895d6 100644 --- a/webapp/app.py +++ b/webapp/app.py @@ -34,7 +34,9 @@ def show_image(): try: # Generate the image file output_path = 'static/output.png' - netvisor_output = subprocess.run([NETVISOR_PATH, 'show', '--file', output_path], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + netvisor_output = subprocess.run([NETVISOR_PATH, 'show', '--file', output_path], + stdout=subprocess.PIPE, stderr=subprocess.PIPE, + check=False) if netvisor_output.returncode == 0: # Send the generated image file as a response return send_file(output_path, mimetype='image/png')