class MailchimpAPIException in Mailchimp 8
Custom Mailchimp API exception.
@package Mailchimp
Hierarchy
- class \Mailchimp\MailchimpAPIException extends \Exception
Expanded class hierarchy of MailchimpAPIException
5 files declare their use of MailchimpAPIException
- MailchimpAdminSettingsForm.php in src/
Form/ MailchimpAdminSettingsForm.php - MailchimpCampaignController.php in modules/
mailchimp_campaign/ src/ Controller/ MailchimpCampaignController.php - MailchimpEcommerce.php in lib/
mailchimp-api-php/ tests/ src/ MailchimpEcommerce.php - MailchimpGuzzleHttpClient.php in lib/
mailchimp-api-php/ src/ http/ MailchimpGuzzleHttpClient.php - MailchimpTestHttpClient.php in lib/
mailchimp-api-php/ tests/ src/ MailchimpTestHttpClient.php
File
- lib/
mailchimp-api-php/ src/ MailchimpAPIException.php, line 12
Namespace
MailchimpView source
class MailchimpAPIException extends Exception {
/**
* @inheritdoc
*/
public function __construct($message = "", $code = 0, Exception $previous = NULL) {
// Construct message from JSON if required.
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);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
MailchimpAPIException:: |
public | function | @inheritdoc |