Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export array 'errors' on call ended with errors #12

Closed
bordeo opened this issue Aug 1, 2018 · 0 comments · Fixed by #13
Closed

Export array 'errors' on call ended with errors #12

bordeo opened this issue Aug 1, 2018 · 0 comments · Fixed by #13
Assignees

Comments

@bordeo
Copy link

bordeo commented Aug 1, 2018

When the API call gets an error is useful to have the errors array returned from the call saved into the Mailchimp_Error object so it could be logged and it make more simple to debug error and problems.

if(floor($info['http_code'] / 100) >= 4) {

Eg:
API POST /batches
If something went wrong it could returns something like this
{ "type": "http://developer.mailchimp.com/documentation/mailchimp/guides/error-glossary/", "title": "Invalid Resource", "status": 400, "detail": "The resource submitted could not be validated. For field-specific details, see the 'errors' array.", "instance": "**************", "errors": [ { "field": "operations.item:80", "message": "Schema describes object, array found instead" }, { "field": "operations.item:93", "message": "Schema describes object, array found instead" }, { "field": "operations.item:118", "message": "Schema describes object, array found instead" } ] }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants