diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2019-08-22 11:12:43 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2019-08-22 11:12:43 +0200 |
commit | cd62b38cc8a9176065955f6ed794ed78517b5dbb (patch) | |
tree | 7f4ab1ed48edd55d2fe32b17eca2b21892090a57 /apps/files_external | |
parent | f88e95b629a9c6b1767d18a937afaf125deefc80 (diff) | |
download | nextcloud-server-cd62b38cc8a9176065955f6ed794ed78517b5dbb.tar.gz nextcloud-server-cd62b38cc8a9176065955f6ed794ed78517b5dbb.zip |
catch auth issues also when php-smbclient is in use
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'apps/files_external')
-rw-r--r-- | apps/files_external/lib/Lib/Storage/SMB.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/apps/files_external/lib/Lib/Storage/SMB.php b/apps/files_external/lib/Lib/Storage/SMB.php index bff23160944..5c8804695bd 100644 --- a/apps/files_external/lib/Lib/Storage/SMB.php +++ b/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; } } |