Automattic\WooCommerce\StoreApi\Schemas
ExtendSchema::throw_exception()
Throws error and/or silently logs it.
Method of the class: ExtendSchema{}
No Hooks.
Return
null
. Nothing (null).
Usage
// private - for code of main (parent) class only $result = $this->throw_exception( $exception_or_error );
- $exception_or_error(string|\Throwable) (required)
- Error message or \Exception.
ExtendSchema::throw_exception() ExtendSchema::throw exception code WC 9.5.1
private function throw_exception( $exception_or_error ) { $exception = is_string( $exception_or_error ) ? new \Exception( $exception_or_error ) : $exception_or_error; wc_caught_exception( $exception ); if ( defined( 'WP_DEBUG' ) && WP_DEBUG && current_user_can( 'manage_woocommerce' ) ) { throw $exception; } }