Currently, only the response error is being surfaced to watchdog, but that tends to be a relatively general and unhelpful error, like "Internal Server Error." The real error is stored in the response data. I think it would be useful to surface the full error details in watchdog error messages.
One example of where this would be helpful is for the signup forms. Currently, if a user enters an invalid email address, they receive an error like, "There was a problem with your newsletter signup to [Insert List Name Here]." That error isn't super helpful to the end user. The real error that Mailchimp sends back is something like "The domain portion of the email address is invalid (the portion after the @: test.com1)", which is way more informative.
Comment | File | Size | Author |
---|---|---|---|
#2 | surface_mailchimp_error_to_watchdog-2290105-2.patch | 785 bytes | anemirovsky |
Comments
Comment #1
anemirovsky CreditAttribution: anemirovsky commentedComment #2
anemirovsky CreditAttribution: anemirovsky commentedI've attached a patch that at least puts the more detailed error report in the watchdog error. It still doesn't solve the problem of surfacing these errors to end users, but that's actually going to require a bigger change, including rethinking the try/catch and what happens when an exception is thrown.
Comment #3
anemirovsky CreditAttribution: anemirovsky commentedAccidentally posted the comment above twice...
Comment #5
jurgenhaasVery nice, this helped me to understand what was going wrong in my case (see #2276143: MailChimp API call to lists/member-info failed: Internal Server Error) and I suggest to include this into the module generally.
Comment #6
marcoscanothe modification indicated was also helpful for me
marking as RTBC
Comment #7
marcoscanoComment #8
arosboro CreditAttribution: arosboro commented+1 helped me discover: Invalid MailChimp List ID
Comment #9
joelpittetRTBC++
I'me getting a bunch of these errors and it would be nice to know what is going on:)
Comment #10
joelpittetCould you make a 7.x-3.x branch? Bumping this to the latest 3.x.
Comment #11
michaellenahan CreditAttribution: michaellenahan commentedRTBC++
Comment #12
ruscoe CreditAttribution: ruscoe commentedComment #15
ruscoe CreditAttribution: ruscoe commentedGreat contribution, thank you. Patch committed to dev branch.