diff options
author | Robin Appelman <robin@icewind.nl> | 2023-05-12 17:52:04 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2023-07-04 17:59:21 +0200 |
commit | 0ff32cadf3f2872280e3b84feedd61727955b5d7 (patch) | |
tree | ed3b381714be5ceeb33ddaa9df106de24e3b17a4 /lib/private/Files/ObjectStore | |
parent | 61f8314f83c64fddcb7d0353c654de07ce0a1be2 (diff) | |
download | nextcloud-server-0ff32cadf3f2872280e3b84feedd61727955b5d7.tar.gz nextcloud-server-0ff32cadf3f2872280e3b84feedd61727955b5d7.zip |
add utility command for object store objects
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private/Files/ObjectStore')
-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; } |