Throw a RuntimeException in the cache aswell
This commit is contained in:
parent
d1511cdbee
commit
2af8fea2be
|
@ -214,6 +214,7 @@ class Cache {
|
||||||
* @param array $data
|
* @param array $data
|
||||||
*
|
*
|
||||||
* @return int file id
|
* @return int file id
|
||||||
|
* @throws \RuntimeException
|
||||||
*/
|
*/
|
||||||
public function put($file, array $data) {
|
public function put($file, array $data) {
|
||||||
if (($id = $this->getId($file)) > -1) {
|
if (($id = $this->getId($file)) > -1) {
|
||||||
|
@ -259,9 +260,12 @@ class Cache {
|
||||||
}
|
}
|
||||||
|
|
||||||
// The file was created in the mean time
|
// The file was created in the mean time
|
||||||
$id = $this->getId($file);
|
if (($id = $this->getId($file)) > -1) {
|
||||||
$this->update($id, $data);
|
$this->update($id, $data);
|
||||||
return $id;
|
return $id;
|
||||||
|
} else {
|
||||||
|
throw new \RuntimeException('File entry exists when inserting and does not exist on select... go away');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@ class Storage {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \OC\Files\Storage\Storage|string $storage
|
* @param \OC\Files\Storage\Storage|string $storage
|
||||||
|
* @throws \RuntimeException
|
||||||
*/
|
*/
|
||||||
public function __construct($storage) {
|
public function __construct($storage) {
|
||||||
if ($storage instanceof \OC\Files\Storage\Storage) {
|
if ($storage instanceof \OC\Files\Storage\Storage) {
|
||||||
|
@ -43,7 +44,7 @@ class Storage {
|
||||||
if ($row = $result->fetchRow()) {
|
if ($row = $result->fetchRow()) {
|
||||||
$this->numericId = $row['numeric_id'];
|
$this->numericId = $row['numeric_id'];
|
||||||
} else {
|
} 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');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue