facebook / facebook-python-business-sdk

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

KeyError when trying to read an error #72

Closed m-vdb closed 9 years ago

m-vdb commented 9 years ago

Backtrace:

File ".../facebookads/api.py", line 117, in error
self.body()
File ".../facebookads/exceptions.py", line 99, in __init__
KeyError: 'path'

Looks like the error is located here. The request_context, i.e. error._call has no key "path".

I got this on version 2.3.3 and using a batch query. Looks like this https://github.com/facebook/facebook-python-ads-sdk/blob/2.4.2/facebookads/api.py#L387-L407 is the problem (I don't see a path key)

rituparnamukherjee commented 9 years ago

Please provide repro steps if you are still seeing this issue.

m-vdb commented 9 years ago

@rituparnamukherjee well, the issue is kind of obvious for a code point of view... I can write a unit test that can make it fail

aparakian commented 9 years ago

... Yes that sounds kind of obvious @rituparnamukherjee :/

rituparnamukherjee commented 9 years ago

Oh, got it. I guess I misunderstood before. Will fix this soon.

rituparnamukherjee commented 9 years ago

This is fixed now!