diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2019-08-22 12:12:43 +0300 |
---|---|---|
committer | Backportbot <backportbot-noreply@rullzer.com> | 2019-09-09 17:52:15 +0300 |
commit | 9e3cbeeaf15f5307c7f8e8c3965a7cea4aeca514 (patch) | |
tree | 43b685dcae129324f8812909cbc809e420e4c25f /apps/files_external | |
parent | ed19134ddbced612d4c885eeea5156222611d448 (diff) |
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 760cc9ef98b..5e3a5d69ebd 100644 --- a/apps/files_external/lib/Lib/Storage/SMB.php +++ b/apps/files_external/lib/Lib/Storage/SMB.php @@ -167,6 +167,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; } } |