diff options
Diffstat (limited to 'init.php')
-rw-r--r-- | init.php | 18 |
1 files changed, 12 insertions, 6 deletions
@@ -97,17 +97,23 @@ class Cache_S3 extends Plugin implements Cache_Adapter { 'Body' => $data ]); } catch (AwsException $e) { - // + user_error($e, E_USER_WARNING); } } public function get(string $filename): ?string { - $res = $this->s3->getObject([ - 'Bucket' => Config::get(self::CACHE_S3_BUCKET), - 'Key' => $this->dir . '/' . $filename - ]); + try { + $res = $this->s3->getObject([ + 'Bucket' => Config::get(self::CACHE_S3_BUCKET), + 'Key' => $this->dir . '/' . $filename + ]); + + return $res['Body']->__toString(); + } catch (AwsException $e) { + user_error($e, E_USER_WARNING); - return $res['Body']->__toString(); + return null; + } } public function get_full_path(string $filename): string { |