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