Skip to content

Commit

Permalink
fix: check for error type before logging
Browse files Browse the repository at this point in the history
  • Loading branch information
dkoo committed Oct 29, 2024
1 parent c1d5193 commit f8b8eef
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ public static function fetch_lists( $limit = null ) {
__( 'Error retrieving Mailchimp lists.', 'newspack_newsletters' )
);
if ( is_wp_error( $lists_response ) || empty( $lists_response['lists'] ) ) {
Newspack_Newsletters_Logger::log( 'Mailchimp cache: Error refreshing cache: ' . ( $lists_response->getMessage() ?? __( 'Error retrieving Mailchimp lists.', 'newspack_newsletters' ) ) );
Newspack_Newsletters_Logger::log( 'Mailchimp cache: Error refreshing cache: ' . ( is_wp_error( $lists_response ) ? $lists_response->getMessage() : __( 'Error retrieving Mailchimp lists.', 'newspack_newsletters' ) ) );
return is_wp_error( $lists_response ) ? $lists_response : [];
}

Expand Down

0 comments on commit f8b8eef

Please sign in to comment.