Accessing to a field can throw exception like "actions is not a field of FacebookAds\\Object\\Insights".
This is wrong: actions is a field of Insights, it's accessible for several objects, but, when the field is not returned by facebook api, the sdk throw this exception.
The issue is in AbstractObject. The presence of the field in the enum should be asserted if the api result is null before throwing an exception.
Accessing to a field can throw exception like
"actions is not a field of FacebookAds\\Object\\Insights"
.This is wrong: actions is a field of Insights, it's accessible for several objects, but, when the field is not returned by facebook api, the sdk throw this exception.
The issue is in AbstractObject. The presence of the field in the enum should be asserted if the api result is null before throwing an exception.
And this leads to ugly catch in client code: