Skip to content

Commit

Permalink
Longer error messages if S3 is not available.
Browse files Browse the repository at this point in the history
  • Loading branch information
kohler committed Nov 9, 2023
1 parent 30e837d commit 16cafa1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion batch/backupdb.php
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,13 @@ private function s3_client() {
$s3b = $Opt["s3_bucket"] ?? null;
$s3c = $Opt["s3_secret"] ?? null;
$s3k = $Opt["s3_key"] ?? null;
if (!is_string($s3b) || !is_string($s3c) || !is_string($s3k)) {
$this->verbose && fwrite(STDERR, "S3 options `s3_bucket`, `s3_secret`, `s3_key` are all required\n");
return null;
}
$s3bp = $Opt["s3_backup_pattern"] ?? null;
if (!is_string($s3b) || !is_string($s3c) || !is_string($s3k) || !is_string($s3bp)) {
if (!is_string($s3bp)) {
$this->verbose && fwrite(STDERR, "S3 option `s3_backup_pattern` required for S3 backup\n");
return null;
}
$this->_s3_client = new S3Client([
Expand Down

0 comments on commit 16cafa1

Please sign in to comment.