diff --git a/testcube/core/api/views.py b/testcube/core/api/views.py index 9b52283..43fd987 100644 --- a/testcube/core/api/views.py +++ b/testcube/core/api/views.py @@ -348,6 +348,7 @@ def handler(self, request, pk=None): return Response(data='Result has been saved.') except Exception as e: + logger.exception('Failed to handle reset result: {}'.format(pk)) instance.reset_status = 3 # failed instance.save() return Response(data=str(e.args), status=400) diff --git a/testcube/core/forms.py b/testcube/core/forms.py index 967552b..7ebcbe4 100644 --- a/testcube/core/forms.py +++ b/testcube/core/forms.py @@ -2,6 +2,7 @@ from django import forms +from testcube.settings import logger from .models import ResultAnalysis, Issue, TestResult, ResetResult from ..runner.models import Task @@ -141,6 +142,8 @@ def _parse_command(command, result): cmd = command.format(result=result) return cmd, None except Exception as e: + logger.exception('Failed to parse command: {}'.format(command)) + message = 'while parsing command "{}" due to {}: {}'.format( command, type(e).__name__, e.args) return command, message diff --git a/testcube/runner/views.py b/testcube/runner/views.py index 494b58d..dcbbee6 100644 --- a/testcube/runner/views.py +++ b/testcube/runner/views.py @@ -74,4 +74,5 @@ def handler(self, request, pk=None): return Response(data={'status': status, 'message': message}) except Exception as e: + logger.exception('Failed to handle task: {}'.format(pk)) return Response(data=str(e.args), status=400) diff --git a/testcube/utils.py b/testcube/utils.py index 78e8a9a..04cb825 100644 --- a/testcube/utils.py +++ b/testcube/utils.py @@ -57,7 +57,8 @@ def append_json(origin_txt, field, value): try: obj = json.loads(origin_txt) except: - logging.warning('Cannot parse to json: {}'.format(origin_txt)) + from testcube.settings import logger + logger.warning('Cannot parse to json: {}'.format(origin_txt)) obj = {} if field in obj: