Title: Error: Mailerlite get_error_message() on array
Last modified: December 12, 2024

---

# Error: Mailerlite get_error_message() on array

 *  [bobvandeleur](https://wordpress.org/support/users/bobvandeleur/)
 * (@bobvandeleur)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/error-mailerlite-get_error_message-on-array/)
 * Hi,
 * I noticed that the plugin generates a Fatal Error on pretty much every call it
   does to MailerLite.
 * The following seems to be the culprit in /includes/crm-library/class-crmlib-mailerlite.
   php:87
 *     ```wp-block-code
       if ( is_wp_error( $result ) || 200 !== $result_code ) {$message = 'Error: ' . $result->get_error_message() . ' '; if ( ! empty( $api_data['error'] ) && is_array( $api_data['error'] ) ) {  foreach ( $api_data['error'] as $key => $value ) {   $message .= $key . ': ' . $value . ' ';  }} formscrm_error_admin_message( 'ERROR', $message ); return array(  'status' => 'error',  'data' => $message, );} else { return array(  'status' => 'ok',  'data' => $api_data, );}
       ```
   
 * Could you remove the part where it checks for a 200 result code? A results code
   anywhere between 200-299 could be a success code, yet it would still check for
   an error message, which doesn’t work.
   Thanks in advance!

Viewing 1 replies (of 1 total)

 *  Plugin Contributor [David Perez](https://wordpress.org/support/users/davidperez/)
 * (@davidperez)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/error-mailerlite-get_error_message-on-array/#post-18195803)
 * Thanks for pointing out! i’ll check it out!

Viewing 1 replies (of 1 total)

The topic ‘Error: Mailerlite get_error_message() on array’ is closed to new replies.

 * ![](https://ps.w.org/formscrm/assets/icon-256x256.gif?rev=3310866)
 * [FormsCRM - Connect Forms to CRM directly](https://wordpress.org/plugins/formscrm/)
 * [Support Threads](https://wordpress.org/support/plugin/formscrm/)
 * [Active Topics](https://wordpress.org/support/plugin/formscrm/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/formscrm/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/formscrm/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [David Perez](https://wordpress.org/support/users/davidperez/)
 * Last activity: [1 year, 3 months ago](https://wordpress.org/support/topic/error-mailerlite-get_error_message-on-array/#post-18195803)
 * Status: not resolved