WC_Order::handle_exception() protected WC 3.7.0
Log an error about this order is exception is encountered.
{} It's a method of the class: WC_Order{}
No Hooks.
Return
Null. Nothing.
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.
Changelog
Since 3.7.0 | Introduced. |
Code of WC_Order::handle_exception() WC Order::handle exception WC 5.0.0
protected function handle_exception( $e, $message = 'Error' ) {
wc_get_logger()->error(
$message,
array(
'order' => $this,
'error' => $e,
)
);
$this->add_order_note( $message . ' ' . $e->getMessage() );
}