Automattic\WooCommerce\Vendor\GraphQL\Utils

LazyException{}WC 1.0

Allows lazy calculation of a complex message when the exception is used in assert().

No Hooks.

Usage

$LazyException = new LazyException();
// use class methods

Methods

  1. public __construct(callable $makeMessage)

LazyException{} code WC 10.9.1

class LazyException extends \Exception
{
    /** @param callable(): string $makeMessage */
    public function __construct(callable $makeMessage)
    {
        parent::__construct($makeMessage());
    }
}