Automattic\WooCommerce\Vendor\GraphQL\Executor

ExecutionResult::setErrorsHandlerpublicWC 1.0

Define custom logic for error handling (filtering, logging, etc).

Expected handler signature is: fn (array $errors, callable $formatter): array

Default handler is: fn (array $errors, callable $formatter): array => array_map($formatter, $errors)

Method of the class: ExecutionResult{}

No Hooks.

Returns

null. Nothing (null).

Usage

$ExecutionResult = new ExecutionResult();
$ExecutionResult->setErrorsHandler( ?callable $errorsHandler ): self;
?callable $errorsHandler(required)
.

ExecutionResult::setErrorsHandler() code WC 10.8.1

public function setErrorsHandler(?callable $errorsHandler): self
{
    $this->errorsHandler = $errorsHandler;

    return $this;
}