2018-11-17 00:37:17 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-05-10 15:15:20 +00:00
|
|
|
module Gitlab
|
|
|
|
module ImportExport
|
2020-03-05 18:08:19 +00:00
|
|
|
class Error < StandardError
|
2021-04-30 12:12:30 +00:00
|
|
|
def self.permission_error(user, object)
|
2020-03-05 18:08:19 +00:00
|
|
|
self.new(
|
|
|
|
"User with ID: %s does not have required permissions for %s: %s with ID: %s" %
|
2021-04-30 12:12:30 +00:00
|
|
|
[user.id, object.class.name, object.name, object.id]
|
2020-03-05 18:08:19 +00:00
|
|
|
)
|
|
|
|
end
|
2021-04-30 12:12:30 +00:00
|
|
|
|
|
|
|
def self.unsupported_object_type_error
|
|
|
|
self.new('Unknown object type')
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.file_compression_error
|
2021-05-20 18:10:33 +00:00
|
|
|
self.new('File compression/decompression failed')
|
2021-04-30 12:12:30 +00:00
|
|
|
end
|
2020-03-05 18:08:19 +00:00
|
|
|
end
|
2016-05-10 15:15:20 +00:00
|
|
|
end
|
2016-05-12 09:29:06 +00:00
|
|
|
end
|