src/Execution/ExtensionErrorHandler.php
public static function handle(Error $error, Closure $next): array
    {
        $underlyingException = $error->getPrevious();

        if ($underlyingException instanceof RendersErrorsExtensions) {
            // Reconstruct the error, passing in the extensions of the underlying exception
            $error = new Error(
                $error->message,
                $error->nodes,
                $error->getSource(),
                $error->getPositions(),
                $error->getPath(),
                $underlyingException,
                $underlyingException->extensionsContent()
            );
        }

        return $next($error);
    }
public static function handle(Error $error, Closure $next): array
    {
        $underlyingException = $error->getPrevious();

        if ($underlyingException instanceof RendersErrorsExtensions) {
            // Reconstruct the error, passing in the extensions of the underlying exception
            $error = new Error(
                $error->message,
                $error->nodes,
                $error->getSource(),
                $error->getPositions(),
                $error->getPath(),
                $underlyingException,
                $underlyingException->extensionsContent()
            );
        }

        return $next($error);
    }
public static function handle ( Error $ error , Closure $ next ) : array { $ underlyingException = $ error -> getPrevious ( ) ; if ( $ underlyingException instanceof RendersErrorsExtensions ) { // Reconstruct the error, passing in the extensions of the underlying exception $ error = new Error ( $ error -> message , $ error -> nodes , $ error -> getSource ( ) , $ error -> getPositions ( ) , $ error -> getPath ( ) , $ underlyingException , $ underlyingException -> extensionsContent ( ) ) ; } return $ next ( $ error ) ; }
Handle Exceptions that implement Nuwave\Lighthouse\Exceptions\RendersErrorsExtensions
and add extra content from them to the 'extensions' key of the Error that is rendered
to the User.

@param  \GraphQL\Error\Error  $error
@param  \Closure  $next
@return array
Handle Exceptions that implement Nuwave \ Lighthouse \ Exceptions \ RendersErrorsExtensions and add extra content from them to the extensions key of the Error that is rendered to the User .