Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

json encoding and decoding does not always work together #10

Open
gkhaburzaniya opened this issue Apr 13, 2017 · 0 comments
Open

json encoding and decoding does not always work together #10

gkhaburzaniya opened this issue Apr 13, 2017 · 0 comments

Comments

@gkhaburzaniya
Copy link

gkhaburzaniya commented Apr 13, 2017

Python 3.4, botoflow 0.8, django 1.9

When the cause of an ActivityTaskFailed is that a django model's .get() raised DoesNotExist, or MultipleObjectsReturned (and probably for many other errors). The JSON encoder encodes this into the details here

https://github.com/boto/botoflow/blob/master/botoflow/data_converter/json_data_converter.py#L152

That leads to something like this "__obj": [ "app.models:DoesNotExist", {}]

Which causes an error when trying to decode it here https://github.com/boto/botoflow/blob/master/botoflow/data_converter/json_data_converter.py#L189, since app.models does not have DoesNotExist, the DoesNotExist is part of the model class which raised the error. IMO, the encoding should write something like

        "__obj": [
            "app.models:ModelName.DoesNotExist",
            {}]

instead. That might be impossible though :(

gkhaburzaniya added a commit to gkhaburzaniya/botoflow that referenced this issue Apr 13, 2017
[boto#10] Let Attribute Errors allow a check for __exc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant