Automattic\WooCommerce\Internal\Admin\Schedulers
MailchimpScheduler::handle_request_error
Handle subscribe API error.
Метод класса: MailchimpScheduler{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
// private - только в коде основоного (родительского) класса $result = $this->handle_request_error( $extra_msg );
- $extra_msg(строка)
- Extra message to log.
По умолчанию:null
Код MailchimpScheduler::handle_request_error() MailchimpScheduler::handle request error WC 10.5.0
private function handle_request_error( $extra_msg = null ) {
// phpcs:ignore
$msg = isset( $extra_msg ) ? 'Incorrect response from Mailchimp API with: ' . print_r( $extra_msg, true ) : 'Error getting a response from Mailchimp API.';
$this->logger->error( $msg, array( 'source' => self::LOGGER_CONTEXT ) );
$accumulated_error_count = intval( get_option( self::SUBSCRIBED_ERROR_COUNT_OPTION_NAME, 0 ) ) + 1;
update_option( self::SUBSCRIBED_ERROR_COUNT_OPTION_NAME, $accumulated_error_count );
}