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

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

23 lines
558 B
Ruby
Raw Normal View History

2019-02-15 15:39:39 +05:30
# frozen_string_literal: true
2016-06-22 15:30:34 +05:30
module Gitlab
module ImportExport
2020-04-08 14:13:33 +05:30
class Error < StandardError
2021-06-08 01:23:25 +05:30
def self.permission_error(user, object)
2020-04-08 14:13:33 +05:30
self.new(
"User with ID: %s does not have required permissions for %s: %s with ID: %s" %
2021-06-08 01:23:25 +05:30
[user.id, object.class.name, object.name, object.id]
2020-04-08 14:13:33 +05:30
)
end
2021-06-08 01:23:25 +05:30
def self.unsupported_object_type_error
self.new('Unknown object type')
end
def self.file_compression_error
2021-09-04 01:27:46 +05:30
self.new('File compression/decompression failed')
2021-06-08 01:23:25 +05:30
end
2020-04-08 14:13:33 +05:30
end
2016-06-22 15:30:34 +05:30
end
end