diff options
author | Robin Appelman <robin@icewind.nl> | 2023-07-04 21:06:48 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-04 21:06:48 +0200 |
commit | bab5a54aed49107c96ebfc783e52fda6e02b0e7a (patch) | |
tree | ed3b381714be5ceeb33ddaa9df106de24e3b17a4 /lib | |
parent | 61f8314f83c64fddcb7d0353c654de07ce0a1be2 (diff) | |
parent | 0ff32cadf3f2872280e3b84feedd61727955b5d7 (diff) | |
download | nextcloud-server-bab5a54aed49107c96ebfc783e52fda6e02b0e7a.tar.gz nextcloud-server-bab5a54aed49107c96ebfc783e52fda6e02b0e7a.zip |
Merge pull request #38731 from nextcloud/backport/38226/stable27
[stable27] add utility command for object store objects
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Files/ObjectStore/S3ObjectTrait.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/private/Files/ObjectStore/S3ObjectTrait.php b/lib/private/Files/ObjectStore/S3ObjectTrait.php index 8fa6d67faa3..e0d0f2ce9c7 100644 --- a/lib/private/Files/ObjectStore/S3ObjectTrait.php +++ b/lib/private/Files/ObjectStore/S3ObjectTrait.php @@ -54,7 +54,7 @@ trait S3ObjectTrait { * @since 7.0.0 */ public function readObject($urn) { - return SeekableHttpStream::open(function ($range) use ($urn) { + $fh = SeekableHttpStream::open(function ($range) use ($urn) { $command = $this->getConnection()->getCommand('GetObject', [ 'Bucket' => $this->bucket, 'Key' => $urn, @@ -88,6 +88,10 @@ trait S3ObjectTrait { $context = stream_context_create($opts); return fopen($request->getUri(), 'r', false, $context); }); + if (!$fh) { + throw new \Exception("Failed to read object $urn"); + } + return $fh; } |