# File lib/nanoc/cli/error_handler.rb, line 105
    def write_compact_error(error, stream)
      # Header
      stream.puts
      stream.puts "Captain! We’ve been hit!"

      # Exception and resolution (if any)
      stream.puts
      stream.puts format_title('Message:')
      stream.puts
      stream.puts "#{error.class}: #{error.message}"
      resolution = self.resolution_for(error)
      stream.puts "#{resolution}" if resolution

      # Compilation stack
      stream.puts
      stream.puts format_title('Compilation stack:')
      stream.puts
      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

      # Backtrace
      stream.puts
      stream.puts format_title('Stack trace:')
      stream.puts
      count = 10
      error.backtrace[0...count].each_with_index do |item, index|
        stream.puts "  #{index}. #{item}"
      end
      if error.backtrace.size > count
        puts "  ... #{error.backtrace.size - count} more lines omitted. See full crash log for details."
      end

      # Issue link
      stream.puts
      stream.puts "If you believe this is a bug in nanoc, please do report it at"
      stream.puts "-> https://github.com/ddfreyne/nanoc/issues/new <-"
      stream.puts
      stream.puts "A detailed crash log has been written to ./crash.log."
    end