MailchimpAPIException.php in Mailchimp 8
File
lib/mailchimp-api-php/src/MailchimpAPIException.php
View source
<?php
namespace Mailchimp;
use Exception;
class MailchimpAPIException extends Exception {
public function __construct($message = "", $code = 0, Exception $previous = NULL) {
if (substr($message, 0, 1) == '{') {
$message_obj = json_decode($message);
$message = $message_obj->status . ': ' . $message_obj->title . ' - ' . $message_obj->detail;
if (!empty($message_obj->errors)) {
$message .= ' ' . serialize($message_obj->errors);
}
}
parent::__construct($message, $code, $previous);
}
}