Welcome to mirror list, hosted at ThFree Co, Russian Federation.

shared.rb « import_export « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9fd0b709ef27159933d9a95082ff36f92d499bb8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
module Gitlab
  module ImportExport
    class Shared
      attr_reader :errors, :opts

      def initialize(opts)
        @opts = opts
        @errors = []
      end

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

      def error(error)
        error_out(error.message, caller[0].dup)
        @errors << error.message
        # Debug:
        Rails.logger.error(error.backtrace.join("\n"))
      end

      private

      def error_out(message, caller)
        Rails.logger.error("Import/Export error raised on #{caller}: #{message}")
      end
    end
  end
end