summaryrefslogtreecommitdiff
path: root/init.php
diff options
context:
space:
mode:
Diffstat (limited to 'init.php')
-rw-r--r--init.php18
1 files changed, 12 insertions, 6 deletions
diff --git a/init.php b/init.php
index aa104b5..00e38e1 100644
--- a/init.php
+++ b/init.php
@@ -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 {