WC_Order::handle_exception
Log an error about this order is exception is encountered.
Method of the class: WC_Order{}
No Hooks.
Returns
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_Order::handle_exception() WC Order::handle exception code WC 10.7.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(), false, false, array( 'note_group' => OrderNoteGroup::ERROR ) );
}