private function CampaignMonitor::addError in Campaign Monitor 7
Add an error to the local stack and call watchdog, if logging is enabled.
Parameters
string $type: Drupal watchdog const. error type.
string $message: The error message.
int $code: Normally the HTTP response code.
17 calls to CampaignMonitor::addError()
- CampaignMonitor::createClientObj in lib/
campaignmonitor.class.inc - Create API client object.
- CampaignMonitor::createList in lib/
campaignmonitor.class.inc - Create a new list at the Campaign Monitor servers.
- CampaignMonitor::createListObj in lib/
campaignmonitor.class.inc - Create API list object.
- CampaignMonitor::createSubscriberObj in lib/
campaignmonitor.class.inc - Create API subscribers object.
- CampaignMonitor::deleteList in lib/
campaignmonitor.class.inc - Delete a list from Campaign Monitor.
File
- lib/
campaignmonitor.class.inc, line 151 - Implementation of the CampaignMonitor class.
Class
- CampaignMonitor
- Implementation of the CampaignMonitor class.
Code
private function addError($type, $message, $code = -1) {
$this->errors[] = [
'type' => $type,
'code' => $code,
'message' => t('%message', [
'%message' => $message,
]),
];
if ($this->logErrors) {
$msg = t('Failed with code: @code and message: @msg', [
'@code' => $code,
'@msg' => $message,
]);
watchdog('campaignmonitor', $msg, NULL, $type);
}
}