jsmrtn / craftagram

Grab Instagram content through the Instagram Basic Display API
Other
14 stars 8 forks source link

[FR] Return error info in craftagram #24

Closed peteeveleigh closed 3 years ago

peteeveleigh commented 4 years ago

It would be really useful if error information was returned when calling craft.craftagram.getInstagramFeed()

Currently the plugin returns null if the response data property is not present. This makes debugging authentication issues VERY hard considering we are often setting this up for clients and don't have access to their Facebook accounts in order to see the developer dashboard.

Changing the return statement on the getInstagramFeed service method means we can check the response in our Twig templates and do something appropriate.

jsmrtn commented 3 years ago

@fantasticmachine This will be covered in 1.2.6, the error will be printed to /storage/logs/craftagram.log

2020-09-30 12:23:41 [][1][error] Failed to get data. Response from Instagram: {"error":{"message":"An unexpected error has occurred. Please retry your request later.","type":"OAuthException","is_transient":true,"code":2,"fbtrace_id":"AbB6VCGMn3o36pAZrkDiLjS"}}