FacebookAds\Object\AdAccount -> createAdCreative() not handling the exception properly. #27
Open
4 tasks done
Labels
bug
Something isn't working
Checklist
Environment
facebook/php-ads-sdk": "5.0.*
Goals
I want to create new Creative while creating a new ad. If it fails then returns specific message returned from FB API.
Expected Results
Speicifc errpr message return from FB API like "The image couldn't be downloaded. Please wait a few minutes and try again."
What do you expect to happen?
Actual Results
"array_key_exists() expects parameter 2 to be array, null given".
What actually happened? Can you provide a stack trace?
{ "error": { "message": "Invalid parameter", "type": "OAuthException", "code": 100, "error_data": "null", "error_subcode": 1487833, "is_transient": true, "error_user_title": "Image wasn't downloaded", "error_user_msg": "Your image, https://someimage.png, couldn't be downloaded. Please wait a few minutes and try again.", "fbtrace_id": "AGIA_kW9Khu9XO05piwiXuw" } }
Steps to Reproduce
We can't provide token and other details for securoty reasons. You can just try to create a new creative by using following payload.
Code Samples & Details
Payload
{ "access_token": "XXX", "object_type": "SHARE", "object_story_spec": { "page_id": "XXX", "link_data": { "message": "Some message", "link": "https://fb.me/", "name": "test", "picture": "https://storage.googleapis.com/facebook-prod-f655/prod/Xes0M1599608679sC4Qj.png", "description": "Some descriotion", "call_to_action": { "type": "LEARN_MORE", "value": { "lead_gen_form_id": "XXX" } } } } }
Now, whenever a exception occurs getData(); method not handling that properly and not returning appropriate error message.
API call
This function is calling createAdCreative() method in FacebookAds\Object\AdAccount class
The text was updated successfully, but these errors were encountered: