debian-mirror-gitlab/lib/backup.rb

32 lines
880 B
Ruby
Raw Normal View History

2018-12-13 13:39:08 +05:30
# frozen_string_literal: true
2018-11-08 19:23:39 +05:30
module Backup
Error = Class.new(StandardError)
2021-10-27 15:23:28 +05:30
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 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
2018-11-08 19:23:39 +05:30
end