summaryrefslogtreecommitdiff
path: root/app/services/projects/hashed_storage/migrate_attachments_service.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/services/projects/hashed_storage/migrate_attachments_service.rb')
-rw-r--r--app/services/projects/hashed_storage/migrate_attachments_service.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/services/projects/hashed_storage/migrate_attachments_service.rb b/app/services/projects/hashed_storage/migrate_attachments_service.rb
index 68b9a72661c..26026899ebe 100644
--- a/app/services/projects/hashed_storage/migrate_attachments_service.rb
+++ b/app/services/projects/hashed_storage/migrate_attachments_service.rb
@@ -1,5 +1,7 @@
module Projects
module HashedStorage
+ AttachmentMigrationError = Class.new(StandardError)
+
class MigrateAttachmentsService < BaseService
attr_reader :logger
@@ -27,7 +29,7 @@ module Projects
if File.exist?(new_path)
logger.error("Cannot migrate attachments from '#{old_path}' to '#{new_path}', target path already exist (PROJECT_ID=#{project.id})")
- return
+ raise AttachmentMigrationError, "Target path '#{new_path}' already exist"
end
# Create hashed storage base path folder