浏览代码

catch auth issues also when php-smbclient is in use

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
tags/v18.0.0beta1
Arthur Schiwon 4 年前
父节点
当前提交
cd62b38cc8
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8
    0
      apps/files_external/lib/Lib/Storage/SMB.php

+ 8
- 0
apps/files_external/lib/Lib/Storage/SMB.php 查看文件

@@ -172,6 +172,14 @@ class SMB extends Common implements INotifyStorage {
} catch (ConnectException $e) {
$this->logger->logException($e, ['message' => 'Error while getting file info']);
throw new StorageNotAvailableException($e->getMessage(), $e->getCode(), $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->logger->logException($e, ['message' => 'Error while getting file info']);
throw new StorageNotAvailableException($e->getMessage(), $e->getCode(), $e);
}
throw $e;
}
}


正在加载...
取消
保存