From 8588328a8f18f0bb9c24437fc78dad50065839f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20T=C3=B3th?= Date: Wed, 7 Mar 2018 16:35:55 +0100 Subject: [PATCH] Improve handling of supervisor errors in ProcessManagingEventHandler --- lib/tfw/components/process_managing_event_handler.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/tfw/components/process_managing_event_handler.py b/lib/tfw/components/process_managing_event_handler.py index 322f9c0..938c5aa 100644 --- a/lib/tfw/components/process_managing_event_handler.py +++ b/lib/tfw/components/process_managing_event_handler.py @@ -38,11 +38,10 @@ class ProcessManagingEventHandler(TriggerlessEventHandler): try: data = data_json['data'] self.processmanager(data['command'], data['process_name']) - data_json['data']['error'] = False return data_json except KeyError: log.error('IGNORING MESSAGE: Invalid data_json received: {}'.format(data_json)) - except SupervisorFault: - data_json['data']['error'] = True + except SupervisorFault as fault: + data_json['data']['error'] = fault.faultString log.debug('Failed to execute command on process: {}'.format(data_json)) return data_json