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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

38 lines
1.3 KiB
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-06-20 00:43:36 +05:30
self.new("Unsupported GitLab version. Minimum supported version is #{BulkImport::MIN_MAJOR_VERSION}.")
2021-09-30 23:02:18 +05:30
end
2023-03-17 16:20:25 +05:30
def self.scope_validation_failure
2023-06-20 00:43:36 +05:30
self.new("Personal access token does not have the required " \
"'api' scope or is no longer valid.")
2023-03-17 16:20:25 +05:30
end
def self.invalid_url
2023-05-27 22:25:52 +05:30
self.new("Invalid source URL. Enter only the base URL of the source GitLab instance.")
2023-03-17 16:20:25 +05:30
end
2023-04-23 21:23:45 +05:30
2023-06-20 00:43:36 +05:30
def self.destination_namespace_validation_failure(destination_namespace)
self.new("Import failed. Destination '#{destination_namespace}' is invalid, or you don't have permission.")
end
def self.destination_slug_validation_failure
self.new("Import failed. Destination URL " \
"#{Gitlab::Regex.oci_repository_path_regex_message}")
end
2023-04-23 21:23:45 +05:30
def self.destination_full_path_validation_failure(full_path)
2023-06-20 00:43:36 +05:30
self.new("Import failed. '#{full_path}' already exists. Change the destination and try again.")
end
def self.setting_not_enabled
self.new("Group import disabled on source or destination instance. " \
"Ask an administrator to enable it on both instances and try again."
)
2023-04-23 21:23:45 +05:30
end
2021-09-30 23:02:18 +05:30
end
end