WordPress at a glance
function is not described

wc_caught_exception() WC 3.3.0

When catching an exception, this allows us to log it if unexpected.

Hooks from the function
Return

null. Nothing.

Usage

wc_caught_exception( $exception_object, $function, $args );
$exception_object(Exception) (required)
The exception object.
$function(string)
The function which threw exception.
$args(array)
The args passed to the function.

Changelog

Since 3.3.0 Introduced.

Code of wc_caught_exception() WC 5.3.0

<?php
function wc_caught_exception( $exception_object, $function = '', $args = array() ) {
	// @codingStandardsIgnoreStart
	$message  = $exception_object->getMessage();
	$message .= '. Args: ' . print_r( $args, true ) . '.';

	do_action( 'woocommerce_caught_exception', $exception_object, $function, $args );
	error_log( "Exception caught in {$function}. {$message}." );
	// @codingStandardsIgnoreEnd
}