Automattic\WooCommerce\Vendor\GraphQL\Executor
ExecutionResult::setErrorsHandler
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() ExecutionResult::setErrorsHandler code WC 10.8.1
public function setErrorsHandler(?callable $errorsHandler): self
{
$this->errorsHandler = $errorsHandler;
return $this;
}