Merge 7565b10a99
into d0cf20cc51
This commit is contained in:
commit
a111798e1f
|
@ -191,13 +191,15 @@ class SMB extends Common implements INotifyStorage {
|
|||
return $this->statCache[$path];
|
||||
} catch (ConnectException $e) {
|
||||
$this->throwUnavailable($e);
|
||||
} catch (NotFoundException $e) {
|
||||
throw new \OCP\Files\NotFoundException($e->getMessage(), 0, $e);
|
||||
} catch (ForbiddenException $e) {
|
||||
// with php-smbclient, this exceptions is thrown when the provided password is invalid.
|
||||
// Possible is also ForbiddenException with a different error code, so we check it.
|
||||
if ($e->getCode() === 1) {
|
||||
$this->throwUnavailable($e);
|
||||
}
|
||||
throw $e;
|
||||
throw new \OCP\Files\ForbiddenException($e->getMessage(), false, $e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -276,6 +278,8 @@ class SMB extends Common implements INotifyStorage {
|
|||
} catch (ConnectException $e) {
|
||||
$this->logger->logException($e, ['message' => 'Error while getting folder content']);
|
||||
throw new StorageNotAvailableException($e->getMessage(), $e->getCode(), $e);
|
||||
} catch (NotFoundException $e) {
|
||||
throw new \OCP\Files\NotFoundException($e->getMessage(), 0, $e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -714,6 +718,10 @@ class SMB extends Common implements INotifyStorage {
|
|||
public function test() {
|
||||
try {
|
||||
return parent::test();
|
||||
} catch (StorageAuthException $e) {
|
||||
return false;
|
||||
} catch (ForbiddenException $e) {
|
||||
return false;
|
||||
} catch (Exception $e) {
|
||||
$this->logger->logException($e);
|
||||
return false;
|
||||
|
|
|
@ -41,6 +41,7 @@ use OC\Files\Filesystem;
|
|||
use OC\Hooks\BasicEmitter;
|
||||
use OCP\Files\Cache\IScanner;
|
||||
use OCP\Files\ForbiddenException;
|
||||
use OCP\Files\NotFoundException;
|
||||
use OCP\ILogger;
|
||||
use OCP\Lock\ILockingProvider;
|
||||
|
||||
|
@ -336,10 +337,15 @@ class Scanner extends BasicEmitter implements IScanner {
|
|||
}
|
||||
}
|
||||
try {
|
||||
$data = $this->scanFile($path, $reuse, -1, null, $lock);
|
||||
if ($data and $data['mimetype'] === 'httpd/unix-directory') {
|
||||
$size = $this->scanChildren($path, $recursive, $reuse, $data['fileid'], $lock);
|
||||
$data['size'] = $size;
|
||||
try {
|
||||
$data = $this->scanFile($path, $reuse, -1, null, $lock);
|
||||
if ($data and $data['mimetype'] === 'httpd/unix-directory') {
|
||||
$size = $this->scanChildren($path, $recursive, $reuse, $data['fileid'], $lock);
|
||||
$data['size'] = $size;
|
||||
}
|
||||
} catch (NotFoundException $e) {
|
||||
$this->removeFromCache($path);
|
||||
return null;
|
||||
}
|
||||
} finally {
|
||||
if ($lock) {
|
||||
|
|
Loading…
Reference in New Issue