diff --git a/src/QiniuAdapter.php b/src/QiniuAdapter.php index 755ca53..6cd6246 100644 --- a/src/QiniuAdapter.php +++ b/src/QiniuAdapter.php @@ -80,7 +80,12 @@ public function writeStream(string $path, $contents, Config $config): void public function read(string $path): string { - $result = file_get_contents($this->privateDownloadUrl($path)); + try { + $result = file_get_contents($this->privateDownloadUrl($path)); + } catch (\Exception $th) { + throw UnableToReadFile::fromLocation($path); + } + if (false === $result) { throw UnableToReadFile::fromLocation($path); }