aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorMarcel Klehr <mklehr@gmx.net>2024-09-26 09:33:32 +0200
committerGitHub <noreply@github.com>2024-09-26 09:33:32 +0200
commit4febe107e65927d9be298e2b45869343b7073874 (patch)
treef72c1f7dd2b647d0f29681c734dfe408510c75f2 /apps
parent9a220989dd1cd3a5792b8fc385ee1d7b1bcc7fb8 (diff)
parentc8a90e941a8b2add613dc1d0555bb5d5fbad08d5 (diff)
downloadnextcloud-server-4febe107e65927d9be298e2b45869343b7073874.tar.gz
nextcloud-server-4febe107e65927d9be298e2b45869343b7073874.zip
Merge pull request #48345 from nextcloud/fix/files_external/forbidden-exception
fix(files_external): Catch correct exception
Diffstat (limited to 'apps')
-rw-r--r--apps/files_external/lib/Lib/Storage/SMB.php16
1 files changed, 9 insertions, 7 deletions
diff --git a/apps/files_external/lib/Lib/Storage/SMB.php b/apps/files_external/lib/Lib/Storage/SMB.php
index 7517c180e37..91a6eab8d09 100644
--- a/apps/files_external/lib/Lib/Storage/SMB.php
+++ b/apps/files_external/lib/Lib/Storage/SMB.php
@@ -160,6 +160,8 @@ class SMB extends Common implements INotifyStorage {
* @param string $path
* @return IFileInfo
* @throws StorageAuthException
+ * @throws \OCP\Files\NotFoundException
+ * @throws \OCP\Files\ForbiddenException
*/
protected function getFileInfo($path) {
try {
@@ -336,7 +338,7 @@ class SMB extends Common implements INotifyStorage {
public function stat($path, $retry = true) {
try {
$result = $this->formatInfo($this->getFileInfo($path));
- } catch (ForbiddenException $e) {
+ } catch (\OCP\Files\ForbiddenException $e) {
return false;
} catch (\OCP\Files\NotFoundException $e) {
return false;
@@ -557,7 +559,7 @@ class SMB extends Common implements INotifyStorage {
$fileInfo = $this->getFileInfo($path);
} catch (\OCP\Files\NotFoundException $e) {
return null;
- } catch (ForbiddenException $e) {
+ } catch (\OCP\Files\ForbiddenException $e) {
return null;
}
if (!$fileInfo) {
@@ -633,7 +635,7 @@ class SMB extends Common implements INotifyStorage {
return $this->getFileInfo($path)->isDirectory() ? 'dir' : 'file';
} catch (\OCP\Files\NotFoundException $e) {
return false;
- } catch (ForbiddenException $e) {
+ } catch (\OCP\Files\ForbiddenException $e) {
return false;
}
}
@@ -668,7 +670,7 @@ class SMB extends Common implements INotifyStorage {
return true;
} catch (\OCP\Files\NotFoundException $e) {
return false;
- } catch (ForbiddenException $e) {
+ } catch (\OCP\Files\ForbiddenException $e) {
return false;
} catch (ConnectException $e) {
throw new StorageNotAvailableException($e->getMessage(), (int)$e->getCode(), $e);
@@ -681,7 +683,7 @@ class SMB extends Common implements INotifyStorage {
return $this->showHidden || !$info->isHidden();
} catch (\OCP\Files\NotFoundException $e) {
return false;
- } catch (ForbiddenException $e) {
+ } catch (\OCP\Files\ForbiddenException $e) {
return false;
}
}
@@ -694,7 +696,7 @@ class SMB extends Common implements INotifyStorage {
return ($this->showHidden || !$info->isHidden()) && (!$info->isReadOnly() || $info->isDirectory());
} catch (\OCP\Files\NotFoundException $e) {
return false;
- } catch (ForbiddenException $e) {
+ } catch (\OCP\Files\ForbiddenException $e) {
return false;
}
}
@@ -705,7 +707,7 @@ class SMB extends Common implements INotifyStorage {
return ($this->showHidden || !$info->isHidden()) && !$info->isReadOnly();
} catch (\OCP\Files\NotFoundException $e) {
return false;
- } catch (ForbiddenException $e) {
+ } catch (\OCP\Files\ForbiddenException $e) {
return false;
}
}