Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 27c491af authored by Fahim Salam Chowdhury's avatar Fahim Salam Chowdhury 👽
Browse files

rnd: update cacheWrapper exception

parent 8e77eccc
Loading
Loading
Loading
Loading
Loading
+15 −11
Original line number Diff line number Diff line
@@ -24,26 +24,30 @@ class CacheWrapper extends Wrapper {
	}

	protected function formatCacheEntry($entry) {
		if (isset($entry['path']) && isset($entry['permissions'])) {
			try {
				throw new \Exception('Access denied', 503);
			} catch (\Exception) {
				$entry['permissions'] &= $this->mask;
			}
		}
		return $entry;
		throw new \OC\ServiceUnavailableException('Service unavailable');
		// if (isset($entry['path']) && isset($entry['permissions'])) {
		// 	try {
		// 		throw new \Exception('Access denied', 503);
		// 	} catch (\Exception) {
		// 		$entry['permissions'] &= $this->mask;
		// 	}
		// }
		// return $entry;
	}

	public function insert($file, $data) {
		throw new \Exception('User data cache insert is disabled.', 503);
		throw new \OC\ServiceUnavailableException('Service unavailable');
		// throw new \Exception('User data cache insert is disabled.', 503);
	}

	public function update($id, $data) {
		throw new \Exception('User data cache update is disabled.', 503);
		throw new \OC\ServiceUnavailableException('Service unavailable');
		// throw new \Exception('User data cache update is disabled.', 503);
	}

	public function remove($fileId) {
		throw new \Exception('User data cache removal is disabled.', 503);
		throw new \OC\ServiceUnavailableException('Service unavailable');
		// throw new \Exception('User data cache removal is disabled.', 503);
	}

	public function searchQuery(ISearchQuery $searchQuery) {