Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix: log error when default getWrapperStorage would return null
Signed-off-by: Robin Appelman <[email protected]>
  • Loading branch information
icewind1991 committed Mar 20, 2024
commit d5fa2ec7c3dc194d2e4f8684b781252e76ad43e0
9 changes: 9 additions & 0 deletions lib/private/Files/Storage/Wrapper/Wrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,14 @@
*/
namespace OC\Files\Storage\Wrapper;

use OC\Files\Storage\FailedStorage;
use OCP\Files\InvalidPathException;
use OCP\Files\Storage\ILockingStorage;
use OCP\Files\Storage\IStorage;
use OCP\Files\Storage\IWriteStreamStorage;
use OCP\Lock\ILockingProvider;
use OCP\Server;
use Psr\Log\LoggerInterface;

class Wrapper implements \OC\Files\Storage\Storage, ILockingStorage, IWriteStreamStorage {
/**
Expand All @@ -60,6 +63,12 @@ public function __construct($parameters) {
* @return \OC\Files\Storage\Storage
*/
public function getWrapperStorage() {
if (!$this->storage) {
$message = "storage wrapper " . get_class($this) . " doesn't have a wrapped storage set";
$logger = Server::get(LoggerInterface::class);
$logger->error($message);
$this->storage = new FailedStorage(['exception' => new \Exception($message)]);
}
return $this->storage;
}

Expand Down