Automattic\WooCommerce\Vendor\GraphQL\Error
FormattedError::prepareFormatter
Prepares final error formatter taking in account $debug flags.
If initial formatter is not set, FormattedError::createFromException is used.
Method of the class: FormattedError{}
No Hooks.
Returns
null. Nothing (null).
Usage
$result = FormattedError::prepareFormatter( ?callable $formatter, $debug ): callable;
- ?callable $formatter(required)
- .
- $debug(int) (required)
- .
FormattedError::prepareFormatter() FormattedError::prepareFormatter code WC 10.9.1
public static function prepareFormatter(?callable $formatter, int $debug): callable
{
return $formatter === null
? static fn (\Throwable $e): array => static::createFromException($e, $debug)
: static fn (\Throwable $e): array => static::addDebugEntries($formatter($e), $e, $debug);
}