Update error messages for when exceptions are caught

This commit is contained in:
Bianca Henderson 2021-10-26 17:38:35 -04:00 committed by Shane McDonald
parent d79da1ef9f
commit 8275082896
No known key found for this signature in database
GPG Key ID: 6F374AF6E9EB9374

View File

@ -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)