Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@owncloud.com>2015-03-11 11:33:50 +0300
committerJoas Schilling <nickvergessen@owncloud.com>2015-03-16 13:47:00 +0300
commit27df0a17350760125f3093e708db717d5487f5f3 (patch)
tree581784d4076aec4163f3293c1666adf6129edf19 /lib
parent171974e43cc8548a6f438cf67bfe85e55810682a (diff)
Throw a RuntimeException in the cache aswell
Diffstat (limited to 'lib')
-rw-r--r--lib/private/files/cache/cache.php10
-rw-r--r--lib/private/files/cache/storage.php3
2 files changed, 9 insertions, 4 deletions
diff --git a/lib/private/files/cache/cache.php b/lib/private/files/cache/cache.php
index 77cffa3af28..1dfa9e1dd10 100644
--- a/lib/private/files/cache/cache.php
+++ b/lib/private/files/cache/cache.php
@@ -211,6 +211,7 @@ class Cache {
* @param array $data
*
* @return int file id
+ * @throws \RuntimeException
*/
public function put($file, array $data) {
if (($id = $this->getId($file)) > -1) {
@@ -256,9 +257,12 @@ class Cache {
}
// The file was created in the mean time
- $id = $this->getId($file);
- $this->update($id, $data);
- return $id;
+ if (($id = $this->getId($file)) > -1) {
+ $this->update($id, $data);
+ return $id;
+ } else {
+ throw new \RuntimeException('File entry exists when inserting and does not exist on select... go away');
+ }
}
}
diff --git a/lib/private/files/cache/storage.php b/lib/private/files/cache/storage.php
index e5185f5c137..9f2739bbedb 100644
--- a/lib/private/files/cache/storage.php
+++ b/lib/private/files/cache/storage.php
@@ -21,6 +21,7 @@ class Storage {
/**
* @param \OC\Files\Storage\Storage|string $storage
+ * @throws \RuntimeException
*/
public function __construct($storage) {
if ($storage instanceof \OC\Files\Storage\Storage) {
@@ -43,7 +44,7 @@ class Storage {
if ($row = $result->fetchRow()) {
$this->numericId = $row['numeric_id'];
} else {
- throw new \Exception('Storage exists when inserting and does not exist on select... go away');
+ throw new \RuntimeException('Storage exists when inserting and does not exist on select... go away');
}
}
}