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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

anemirovsky’s picture

Issue summary: View changes
anemirovsky’s picture

I'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.

anemirovsky’s picture

Status: Active » Needs review

Accidentally posted the comment above twice...

Status: Needs review » Needs work

The last submitted patch, 2: surface_mailchimp_error_to_watchdog-2290105-2.patch, failed testing.

jurgenhaas’s picture

Very 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.

marcoscano’s picture

the modification indicated was also helpful for me

marking as RTBC

marcoscano’s picture

Status: Needs work » Reviewed & tested by the community
arosboro’s picture

+1 helped me discover: Invalid MailChimp List ID

joelpittet’s picture

RTBC++

I'me getting a bunch of these errors and it would be nice to know what is going on:)

joelpittet’s picture

Version: 7.x-3.1 » 7.x-3.11

Could you make a 7.x-3.x branch? Bumping this to the latest 3.x.

michaellenahan’s picture

RTBC++

ruscoe’s picture

Version: 7.x-3.11 » 7.x-3.x-dev

  • ruscoe committed 52219fe on 7.x-3.x authored by anemirovsky
    Issue #2290105 by anemirovsky: Surfaced Mailchimp API errors to watchdog...
ruscoe’s picture

Status: Reviewed & tested by the community » Fixed

Great contribution, thank you. Patch committed to dev branch.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.