Skip to content

Commit 5ef2ddc

Browse files
authored
Merge pull request #50 from mailchimp/fix/49
Make the API authentication error message more general.
2 parents ef1a6f5 + a3d10a9 commit 5ef2ddc

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/mailchimp/mailchimp.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ public function get( $endpoint, $count = 10, $fields = array() ) {
128128
// Check if Access Token is invalid/revoked.
129129
if ( in_array( $request['response']['code'], array( 401, 403 ), true ) ) {
130130
update_option( 'mailchimp_sf_auth_error', true );
131+
return new WP_Error( 'mailchimp-auth-error', esc_html__( 'Authentication failed.', 'mailchimp' ) );
131132
}
132133

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

0 commit comments

Comments
 (0)