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

MarketoException object has no attribute msg #11

Open
tejasipa opened this issue Dec 9, 2016 · 0 comments
Open

MarketoException object has no attribute msg #11

tejasipa opened this issue Dec 9, 2016 · 0 comments

Comments

@tejasipa
Copy link

tejasipa commented Dec 9, 2016

I am getting this error but only on some runs of the get_multiple_leads_by_list_id_yield. It seems like it's tied to perhaps an empty Marketo API response or a malformed one. Is there any way to handle this situation?

`Traceback (most recent call last):
File "mksync-newrecords.py", line 29, in
for pinto in mc.execute(method='get_multiple_leads_by_list_id_yield', listId='18', fields=['id','email'], batchSize=200):
File "/home/luisp/.pyenv/versions/marketo/lib/python3.5/site-packages/marketorestpython/client.py", line 328, in get_multiple_leads_by_list_id_yield
if not result['success']: raise MarketoException(result['errors'][0])
marketorestpython.helper.exceptions.MarketoException
During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "mksync-newrecords.py", line 46, in
print ("Exception: {}".format(e))
File "/home/luisp/.pyenv/versions/marketo/lib/python3.5/site-packages/marketorestpython/helper/exceptions.py", line 10, in str
return self.msg, self.code
AttributeError: 'MarketoException' object has no attribute 'msg'`

in the actual script the exception is being handled by:

except Exception as e: print ("Exception: {}".format(e)) print("Sys Exc Info: {}".format(sys.exc_info()[0]))

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