From 3f4aa5245b79456ed089de53ac768d1c4748547b Mon Sep 17 00:00:00 2001 From: Stefan Midjich Date: Wed, 7 Dec 2016 14:52:58 +0100 Subject: [PATCH] fixed error handling for failed plugin import. --- portal.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/portal.py b/portal.py index 8c722d7..7d7764b 100644 --- a/portal.py +++ b/portal.py @@ -209,7 +209,15 @@ def job_status(job_id): @app.route('/approve', method='POST') def approve_client(): response.content_type = 'application/json' - jobs = dispatch_plugins() + try: + jobs = dispatch_plugins() + except Exception as e: + response.status = 500 + jobs = { + 'result': { + 'error': str(e) + } + } return json.dumps(jobs)