Better messaging for the configurators.

We were generating 500 errors here
This commit is contained in:
mike cullerton 2021-10-22 12:53:26 -04:00
parent 7e3c47f8bf
commit a7fcaac5ef
1 changed files with 6 additions and 1 deletions

View File

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