Skip to content

Commit

Permalink
Merge pull request #50 from mailchimp/fix/49
Browse files Browse the repository at this point in the history
Make the API authentication error message more general.
  • Loading branch information
dkotter authored Aug 20, 2024
2 parents ef1a6f5 + a3d10a9 commit 5ef2ddc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/mailchimp/mailchimp.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ public function get( $endpoint, $count = 10, $fields = array() ) {
// Check if Access Token is invalid/revoked.
if ( in_array( $request['response']['code'], array( 401, 403 ), true ) ) {
update_option( 'mailchimp_sf_auth_error', true );
return new WP_Error( 'mailchimp-auth-error', esc_html__( 'Authentication failed.', 'mailchimp' ) );
}

$error = json_decode( $request['body'], true );
Expand Down

0 comments on commit 5ef2ddc

Please sign in to comment.