summaryrefslogtreecommitdiff
path: root/lib/backup.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-08-19 09:08:42 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-08-19 09:08:42 +0000
commitb76ae638462ab0f673e5915986070518dd3f9ad3 (patch)
treebdab0533383b52873be0ec0eb4d3c66598ff8b91 /lib/backup.rb
parent434373eabe7b4be9593d18a585fb763f1e5f1a6f (diff)
downloadgitlab-ce-b76ae638462ab0f673e5915986070518dd3f9ad3.tar.gz
Add latest changes from gitlab-org/gitlab@14-2-stable-eev14.2.0-rc42
Diffstat (limited to 'lib/backup.rb')
-rw-r--r--lib/backup.rb39
1 files changed, 39 insertions, 0 deletions
diff --git a/lib/backup.rb b/lib/backup.rb
index 2712b33b4b4..91682645a9a 100644
--- a/lib/backup.rb
+++ b/lib/backup.rb
@@ -2,4 +2,43 @@
module Backup
Error = Class.new(StandardError)
+
+ class FileBackupError < Backup::Error
+ attr_reader :app_files_dir, :backup_tarball
+
+ def initialize(app_files_dir, backup_tarball)
+ @app_files_dir = app_files_dir
+ @backup_tarball = backup_tarball
+ end
+
+ def message
+ "Failed to create compressed file '#{backup_tarball}' when trying to backup the following paths: '#{app_files_dir}'"
+ end
+ end
+
+ class RepositoryBackupError < Backup::Error
+ attr_reader :container, :backup_repos_path
+
+ def initialize(container, backup_repos_path)
+ @container = container
+ @backup_repos_path = backup_repos_path
+ end
+
+ def message
+ "Failed to create compressed file '#{backup_repos_path}' when trying to backup the following paths: '#{container.disk_path}'"
+ end
+ end
+
+ class DatabaseBackupError < Backup::Error
+ attr_reader :config, :db_file_name
+
+ def initialize(config, db_file_name)
+ @config = config
+ @db_file_name = db_file_name
+ end
+
+ def message
+ "Failed to create compressed file '#{db_file_name}' when trying to backup the main database:\n - host: '#{config[:host]}'\n - port: '#{config[:port]}'\n - database: '#{config[:database]}'"
+ end
+ end
end