blob: 616b58d1852cd2b7c2e5218967a5b400470b73e0 (
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
30
31
32
33
34
35
36
37
38
|
# frozen_string_literal: true
module BulkImports
class Error < StandardError
def self.unsupported_gitlab_version
self.new("Unsupported GitLab version. Minimum supported version is #{BulkImport::MIN_MAJOR_VERSION}.")
end
def self.scope_validation_failure
self.new("Personal access token does not have the required " \
"'api' scope or is no longer valid.")
end
def self.invalid_url
self.new("Invalid source URL. Enter only the base URL of the source GitLab instance.")
end
def self.destination_namespace_validation_failure
self.new("Import failed. Destination group or subgroup path " \
"#{Gitlab::Regex.bulk_import_destination_namespace_path_regex_message}")
end
def self.destination_slug_validation_failure
self.new("Import failed. Destination URL " \
"#{Gitlab::Regex.oci_repository_path_regex_message}")
end
def self.destination_full_path_validation_failure(full_path)
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."
)
end
end
end
|