debian-mirror-gitlab/lib/bulk_imports/error.rb

24 lines
804 B
Ruby
Raw Normal View History

2021-09-30 23:02:18 +05:30
# frozen_string_literal: true
module BulkImports
class Error < StandardError
def self.unsupported_gitlab_version
2023-04-23 21:23:45 +05:30
self.new("Unsupported GitLab version. Source instance must run GitLab version #{BulkImport::MIN_MAJOR_VERSION} " \
"or later.")
2021-09-30 23:02:18 +05:30
end
2023-03-17 16:20:25 +05:30
def self.scope_validation_failure
self.new("Import aborted as the provided personal access token does not have the required 'api' scope or " \
"is no longer valid.")
end
def self.invalid_url
self.new("Import aborted as it was not possible to connect to the provided GitLab instance URL.")
end
2023-04-23 21:23:45 +05:30
def self.destination_full_path_validation_failure(full_path)
self.new("Import aborted as '#{full_path}' already exists. Change the destination and try again.")
end
2021-09-30 23:02:18 +05:30
end
end