Skip to content

Commit

Permalink
create missing container
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrajodas committed Jan 17, 2025
1 parent e1a465c commit fa1bbfb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
12 changes: 1 addition & 11 deletions src/Storages/AwsS3Storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,7 @@ public function getBackup(Client $sapi, string $path): Backup
]);
} catch (S3Exception $e) {
if ($e->getAwsErrorCode() === 'NoSuchKey') {
if ($this->userDefinedCredentials) {
$this->createBackupPath($path);
} else {
throw new UserException(
sprintf(
'Backup path "%s" not found in the bucket "%s".',
$path,
$this->config->getBucket(),
),
);
}
$this->createBackupPath($path);
} else {
throw new UserException($e->getAwsErrorMessage() ?? $e->getMessage());
}
Expand Down
5 changes: 1 addition & 4 deletions src/Storages/AzureBlobStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,7 @@ public function getBackup(Client $sapi, string $path): Backup
throw $e;
}
if (!in_array($path, $listContainers)) {
throw new UserException(sprintf(
'The specified container "%s" does not exist.',
$path,
));
$client->createContainer($path);
}

return new AbsBackup($sapi, $client, $path, $this->logger);
Expand Down

0 comments on commit fa1bbfb

Please sign in to comment.