protected function resolve($index)
    {
        if (! isset($this->stack[$index]))
        {
            return new ErrorHandler;
        }

        $next = $this->resolve($index + 1);

        $item = $this->stack[(integer) $index];

        return new NextHandler($item, $next);
    }