BigW Consortium Gitlab

shared.rb 633 Bytes
Newer Older
1
module Gitlab
2 3
  module ImportExport
    class Shared
4
      attr_reader :errors, :opts
5

6 7
      def initialize(opts)
        @opts = opts
8
        @errors = []
9 10 11
      end

      def export_path
12
        @export_path ||= Gitlab::ImportExport.export_path(relative_path: opts[:relative_path])
13
      end
14

15 16 17 18 19
      def error(error)
        error_out(error.message, caller[0].dup)
        @errors << error.message
        # Debug:
        Rails.logger.error(error.backtrace)
20 21 22 23 24 25 26
      end

      private

      def error_out(message, caller)
        Rails.logger.error("Import/Export error raised on #{caller}: #{message}")
      end
27 28
    end
  end
James Lopez committed
29
end