fixed error handling for failed plugin import.

This commit is contained in:
Stefan Midjich 2016-12-07 14:52:58 +01:00
parent 7950785757
commit 3f4aa5245b

View file

@ -209,7 +209,15 @@ def job_status(job_id):
@app.route('/approve', method='POST') @app.route('/approve', method='POST')
def approve_client(): def approve_client():
response.content_type = 'application/json' 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) return json.dumps(jobs)