WC_Abstract_Order::handle_exception()protectedWC 3.7.0

Log an error about this order is exception is encountered.

Method of the class: WC_Abstract_Order{}

No Hooks.

Return

null. Nothing (null).

Usage

// protected - for code of main (parent) or child class
$result = $this->handle_exception( $e, $message );
$e(Exception) (required)
Exception object.
$message(string)
Message regarding exception thrown.
Default: 'Error'

Changelog

Since 3.7.0 Introduced.

WC_Abstract_Order::handle_exception() code WC 8.7.0

protected function handle_exception( $e, $message = 'Error' ) {
	wc_get_logger()->error(
		$message,
		array(
			'order' => $this,
			'error' => $e,
		)
	);
}