6 declare(strict_types=1);
12 use Psr\Log\LoggerInterface;
37 $this->appState = $appState;
53 public function create(\Throwable $exception, $internalErrorMessage =
null) : array
56 $reportId = uniqid(
"graph-ql-");
57 $message =
"Report ID: {$reportId}; Message: {$exception->getMessage()}";
58 $code = $exception->getCode();
59 $loggedException = new \Exception(
$message,
$code, $exception);
60 $this->logger->critical($loggedException);
63 return \GraphQL\Error\FormattedError::createFromException(
66 ? \GraphQL\Error\Debug::INCLUDE_DEBUG_MESSAGE | \GraphQL\Error\Debug::INCLUDE_TRACE :
false,
registerShutdownFunction()