Skip to content

JSON must be escaped when sending back certain responses. #4

Description

@bstempi

Snippet from a traceback:

  File "/usr/local/lib/python2.7/dist-packages/pyswfaws/activityworker.py", line 142, in start
    should_exit = self.handle_exception(e, activity_task)
  File "/usr/local/lib/python2.7/dist-packages/pyswfaws/activityworker.py", line 95, in handle_exception
    details=exception.message[:3000])
  File "/usr/local/lib/python2.7/dist-packages/boto/swf/layer1.py", line 224, in respond_activity_task_failed
    'reason': reason,
  File "/usr/local/lib/python2.7/dist-packages/boto/swf/layer1.py", line 118, in json_request
    return self.make_request(action, json_input, object_hook)
  File "/usr/local/lib/python2.7/dist-packages/boto/swf/layer1.py", line 145, in make_request
    raise excp_cls(response.status, response.reason, body=json_body)
boto.exception.SWFResponseError: SWFResponseError: 400 Bad Request
{u'Message': u'Start of list found where not expected', u'__type': u'com.amazon.coral.service#SerializationException'}

I happen to know that exception.message contains square brackets, which SWF is interpreting as a list. The framework needs to escape these types of things.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions