# File lib/nanoc/cli/error_handler.rb, line 279
    def write_compilation_stack(stream, error, params={})
      self.write_section_header(stream, 'Compilation stack', params)

      if self.stack.empty?
        stream.puts "  (empty)"
      else
        self.stack.reverse.each do |obj|
          if obj.is_a?(Nanoc::ItemRep)
            stream.puts "  - [item]   #{obj.item.identifier} (rep #{obj.name})"
          else # layout
            stream.puts "  - [layout] #{obj.identifier}"
          end
        end
      end
    end