WC_Order::handle_exception
Log an error about this order is exception is encountered.
Метод класса: WC_Order{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->handle_exception( $e, $message );
- $e(Exception) (обязательный)
- Exception object.
- $message(строка)
- Message regarding exception thrown.
По умолчанию:'Error'
Список изменений
| С версии 3.7.0 | Введена. |
Код WC_Order::handle_exception() WC Order::handle exception 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 ) );
}