From 8275082896ac8a51ae14f3eac4091c50b7a6e798 Mon Sep 17 00:00:00 2001 From: Bianca Henderson Date: Tue, 26 Oct 2021 17:38:35 -0400 Subject: [PATCH] Update error messages for when exceptions are caught --- awx/main/tasks.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/awx/main/tasks.py b/awx/main/tasks.py index 9ea2447126..948ceb6c79 100644 --- a/awx/main/tasks.py +++ b/awx/main/tasks.py @@ -3073,8 +3073,8 @@ class AWXReceptorJob: if self.unit_id is not None and settings.RECEPTOR_RELEASE_WORK: try: receptor_ctl.simple_command(f"work release {self.unit_id}") - except Exception as e: - logger.exception(e) + except Exception: + logger.exception(f"Error releasing work unit {self.unit_id}.") @property def sign_work(self): @@ -3131,10 +3131,10 @@ class AWXReceptorJob: unit_status = receptor_ctl.simple_command(f'work status {self.unit_id}') detail = unit_status.get('Detail', None) state_name = unit_status.get('StateName', None) - except Exception as e: + except Exception: detail = '' state_name = '' - logger.exception(e) + logger.exception(f'An error was encountered while canceling work unit {self.unit_id}') if 'exceeded quota' in detail: logger.warn(detail)