src/Executor/ReferenceExecutor.php
public function completeValueWithLocatedError(
        Type $returnType,
        $fieldNodes,
        ResolveInfo $info,
        $path,
        $result
    ) {
        try {
            $completed = $this->completeValue(
                $returnType,
                $fieldNodes,
                $info,
                $path,
                $result
            );
            $promise   = $this->getPromise($completed);
            if ($promise) {
                return $promise->then(
                    null,
                    function ($error) use ($fieldNodes, $path) {
                        return $this->exeContext->promises->createRejected(Error::createLocatedError(
                            $error,
                            $fieldNodes,
                            $path
                        ));
                    }
                );
            }

            return $completed;
        } catch (Exception $error) {
            throw Error::createLocatedError($error, $fieldNodes, $path);
        } catch (Throwable $error) {
            throw Error::createLocatedError($error, $fieldNodes, $path);
        }
    }
public function completeValueWithLocatedError(
        Type $returnType,
        $fieldNodes,
        ResolveInfo $info,
        $path,
        $result
    ) {
        try {
            $completed = $this->completeValue(
                $returnType,
                $fieldNodes,
                $info,
                $path,
                $result
            );
            $promise   = $this->getPromise($completed);
            if ($promise) {
                return $promise->then(
                    null,
                    function ($error) use ($fieldNodes, $path) {
                        return $this->exeContext->promises->createRejected(Error::createLocatedError(
                            $error,
                            $fieldNodes,
                            $path
                        ));
                    }
                );
            }

            return $completed;
        } catch (Exception $error) {
            throw Error::createLocatedError($error, $fieldNodes, $path);
        } catch (Throwable $error) {
            throw Error::createLocatedError($error, $fieldNodes, $path);
        }
    }
This is a small wrapper around completeValue which annotates errors with
location information.

@param FieldNode[] $fieldNodes
@param string[]    $path
@param mixed       $result

@return mixed[]|mixed|Promise|null

@throws Error