From 0a23195a7b7fdbedf23f37216096dcc99c915b9e Mon Sep 17 00:00:00 2001 From: AlanCoding Date: Wed, 11 Apr 2018 10:59:16 -0400 Subject: [PATCH] always log uncaught task exceptions --- 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 b01e5331f6..21f10a16db 100644 --- a/awx/main/tasks.py +++ b/awx/main/tasks.py @@ -1000,10 +1000,10 @@ class BaseTask(Task): ) except Exception: - if status != 'canceled': - tb = traceback.format_exc() - if settings.DEBUG: - logger.exception('%s Exception occurred while running task', instance.log_format) + # run_pexpect does not throw exceptions for cancel or timeout + # this could catch programming or file system errors + tb = traceback.format_exc() + logger.exception('%s Exception occurred while running task', instance.log_format) finally: try: if stdout_handle: