From a7fcaac5ef4a9a56f512f451871c86b4910c8bfb Mon Sep 17 00:00:00 2001 From: mike cullerton Date: Fri, 22 Oct 2021 12:53:26 -0400 Subject: [PATCH] Better messaging for the configurators. We were generating 500 errors here --- crc/services/workflow_service.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crc/services/workflow_service.py b/crc/services/workflow_service.py index 86cdff2f..80cdd020 100755 --- a/crc/services/workflow_service.py +++ b/crc/services/workflow_service.py @@ -282,7 +282,12 @@ class WorkflowService(object): # jsonify, and de-jsonify the data to mimic how data will be returned from the front end for forms and assures # we aren't generating something that can't be serialized. - form_data_string = json.dumps(form_data) + try: + form_data_string = json.dumps(form_data) + except TypeError as te: + raise ApiError.from_task(code='serialize_error', + message=f'Something cannot be serialized. Message is: {te}', + task=task) task.data.update(json.loads(form_data_string)) @staticmethod