getPrevious(); if ($underlyingException instanceof RendersErrorsExtensions) { // Reconstruct the error, passing in the extensions of the underlying exception return $next(new Error( $error->getMessage(), // @phpstan-ignore-next-line graphql-php and phpstan disagree with themselves $error->getNodes(), $error->getSource(), $error->getPositions(), $error->getPath(), $underlyingException, $underlyingException->extensionsContent() )); } return $next($error); } }