Automattic\WooCommerce\Internal\OrderWithdrawal

OrderWithdrawalFormProcessor::log_order_note_error │ private │ WC 1.0

Log an order note failure without failing the submission.

Метод класса: OrderWithdrawalFormProcessor{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

// private - только в коде основоного (родительского) класса
$result = $this->log_order_note_error( $order, ?Throwable $e ): void;
$order(WC_Order) (обязательный)
Matched order.
?Throwable $e
.
По умолчанию: null

Код OrderWithdrawalFormProcessor::log_order_note_error() WC 11.2.2

private function log_order_note_error( WC_Order $order, ?Throwable $e = null ): void {
	$message = sprintf( 'Order withdrawal note could not be added to order %d.', $order->get_id() );

	if ( $e instanceof Throwable ) {
		$message .= sprintf( ' Error: %s', $e->getMessage() );
	}

	wc_get_logger()->warning(
		$message,
		array( 'source' => self::LOGGER_SOURCE )
	);
}