Browse Source

handle AccessDenied error when checking if external s3 support versions

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
pull/33280/head
Matthieu Gallien 4 years ago
committed by Matthieu Gallien (Rebase PR Action)
parent
commit
54c05bcdb9
  1. 2
      apps/files_external/lib/Lib/Storage/AmazonS3.php

2
apps/files_external/lib/Lib/Storage/AmazonS3.php

@ -744,7 +744,7 @@ class AmazonS3 extends \OC\Files\Storage\Common {
return $result->get('Status') === 'Enabled';
} catch (S3Exception $s3Exception) {
// This is needed for compatibility with Storj gateway which does not support versioning yet
if ($s3Exception->getAwsErrorCode() === 'NotImplemented') {
if ($s3Exception->getAwsErrorCode() === 'NotImplemented' || $s3Exception->getAwsErrorCode() === 'AccessDenied') {
return false;
}
throw $s3Exception;

Loading…
Cancel
Save