Skip to content

Commit 31f1ff8

Browse files
authored
Merge pull request #39367 from nextcloud/s3-fopen-exception
handle more exceptions in AmazonS3::fopen
2 parents 70a9d66 + b0e663f commit 31f1ff8

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ public function fopen($path, $mode) {
497497

498498
try {
499499
return $this->readObject($path);
500-
} catch (S3Exception $e) {
500+
} catch (\Exception $e) {
501501
$this->logger->error($e->getMessage(), [
502502
'app' => 'files_external',
503503
'exception' => $e,

lib/private/Files/Stream/SeekableHttpStream.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,9 @@ public function stream_tell() {
219219
public function stream_stat() {
220220
if ($this->getCurrent()) {
221221
$stat = fstat($this->getCurrent());
222-
$stat['size'] = $this->totalSize;
222+
if ($stat) {
223+
$stat['size'] = $this->totalSize;
224+
}
223225
return $stat;
224226
} else {
225227
return false;

0 commit comments

Comments
 (0)