You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: errors.rb
    path of file: ./repos/rubygems/lib/rubygems/vendor/molinillo/lib/molinillo
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module Gem::Molinillo
  # An error that occurred during the resolution process
  class ResolverError < StandardError; end

  # An error caused by searching for a dependency that is completely unknown,
  # i.e. has no versions available whatsoever.
  class NoSuchDependencyError < ResolverError
    # @return [Object] the dependency that could not be found
    attr_accessor :dependency

    # @return [Array<Object>] the specifications that depended upon {#dependency}
    attr_accessor :required_by

    # Initializes a new error with the given missing dependency.
    # @param [Object] dependency @see {#dependency}
    # @param [Array<Object>] required_by @see {#required_by}
    def initialize(dependency, required_by = [])
      @dependency = dependency
      @required_by = required_by.uniq
      super()
    end

    # The error message for the missing dependency, including the specifications
    # that had this dependency.
    def message
      sources = required_by.map { |r| "`#{r}`" }.join(' and ')
      message = "Unable to find a specification for `#{dependency}`"
      message += " depended upon by #{sources}" unless sources.empty?
      message
    end
  end

  # An error caused by attempting to fulfil a dependency that was circular
  #
  # @note This exception will be thrown if and only if a {Vertex} is added to a
  #   {DependencyGraph} that has a {DependencyGraph::Vertex#path_to?} an
  #   existing {DependencyGraph::Vertex}
  class CircularDependencyError < ResolverError
    # [Set<Object>] the dependencies responsible for causing the error
    attr_reader :
    
    def message_with_trees(opts = {})
      solver_name = opts.delete(:solver_name) { self.class.name.split('::').first }
      possibility_type = opts.delete(:possibility_type) { 'possibility named' }
      reduce_trees = opts.delete(:reduce_trees) { proc { |trees| trees.uniq.sort_by(&:to_s) } }
      printable_requirement = opts.delete(:printable_requirement) { proc { |req| req.to_s } }
      additional_message_for_conflict = opts.delete(:additional_message_for_conflict) { proc {} }
      version_for_spec = opts.delete(:version_for_spec) { proc(&:to_s) }
      incompatible_version_message_for_conflict = opts.delete(:incompatible_version_message_for_conflict) do
        proc do |name, _conflict|
          %(#{solver_name} could not find compatible versions for #{possibility_type} "#{name}":)
        end
      end

      full_message_for_conflict = opts.delete(:full_message_for_conflict) do
        proc do |name, conflict|
          o = "\n".dup << incompatible_version_message_for_conflict.call(name, conflict) << "\n"
          if conflict.locked_requirement
            o << %(  In snapshot (#{name_for_locking_dependency_source}):\n)
            o << %(    #{printable_requirement.call(conflict.locked_requirement)}\n)
            o << %(\n)
          end
          o << %(  In #{name_for_explicit_dependency_source}:\n)
          trees = reduce_trees.call(conflict.requirement_trees)

          o << trees.map do |tree|
            t = ''.dup
            depth = 2
            tree.each do |req|
              t << '  ' * depth << printable_requirement.call(req)
              unless tree.last == req
                if spec = conflict.activated_by_name[name_for(req)]
                  t << %( was resolved to #{version_for_spec.call(spec)}, which)
                end
                t << %( depends on)
              end
              t << %(\n)
              depth += 1
            end
            t
          end.join("\n")

          additional_message_for_conflict.call(o, name, conflict)

          o
        end