facebook / facebook-python-business-sdk

Python SDK for Meta Marketing APIs
https://developers.facebook.com/docs/business-sdk
Other
1.28k stars 631 forks source link

facebookads and facebook_business bug. Wrong error handling for "Error validating access token: The user is enrolled in a blocking, logged-in checkpoint." But raise "AttributeError: 'str' object has no attribute 'get'" #525

Closed vovkas86 closed 5 years ago

vovkas86 commented 5 years ago

facebook returning response:

{"error":{"message":"Error validating access token: The user is enrolled in a blocking, logged-in checkpoint","type":"OAuthException","code":190,"error_subcode":490,"error_data":"{\"checkpoint_flow_id\":\"207799259245384\",\"checkpoint_content_id\":\"0\",\"show_native_checkpoints\":\"\"}","fbtrace_id":"ES\/0Wu2TJ5H"}}

facebookads exceptions line 80 facebook_business/exceptions.py:80 raise AttributeError: 'str' object has no attribute 'get'` because "error_data" is escaped json string. Looks like it's twise json.dumps for this error response.

jingping2015 commented 5 years ago

This will be fixed in next release.