Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
catch auth issues also when php-smbclient is in use
Signed-off-by: Arthur Schiwon <[email protected]>
  • Loading branch information
blizzz authored and Backportbot committed Sep 9, 2019
commit f29395e89dd511ab9840197aa3038c9503eacb1c
8 changes: 8 additions & 0 deletions apps/files_external/lib/Lib/Storage/SMB.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,14 @@ protected function getFileInfo($path) {
} 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;
}
}

Expand Down