Skip to content

Commit

Permalink
Merge pull request #39367 from nextcloud/s3-fopen-exception
Browse files Browse the repository at this point in the history
handle more exceptions in AmazonS3::fopen
  • Loading branch information
icewind1991 authored Jul 20, 2023
2 parents 70a9d66 + b0e663f commit 31f1ff8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/files_external/lib/Lib/Storage/AmazonS3.php
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ public function fopen($path, $mode) {

try {
return $this->readObject($path);
} catch (S3Exception $e) {
} catch (\Exception $e) {
$this->logger->error($e->getMessage(), [
'app' => 'files_external',
'exception' => $e,
Expand Down
4 changes: 3 additions & 1 deletion lib/private/Files/Stream/SeekableHttpStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,9 @@ public function stream_tell() {
public function stream_stat() {
if ($this->getCurrent()) {
$stat = fstat($this->getCurrent());
$stat['size'] = $this->totalSize;
if ($stat) {
$stat['size'] = $this->totalSize;
}
return $stat;
} else {
return false;
Expand Down

0 comments on commit 31f1ff8

Please sign in to comment.