gitlab-org--gitlab-foss/lib/gitlab/import_export/shared.rb

30 lines
644 B
Ruby
Raw Normal View History

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:
2017-09-03 14:51:50 -04:00
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
2016-03-08 12:20:32 -05:00
end