catch auth issues also when php-smbclient is in use
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
parent
c092a011e3
commit
c70cb8d57f
|
@ -172,6 +172,14 @@ class SMB extends Common implements INotifyStorage {
|
||||||
} catch (ConnectException $e) {
|
} catch (ConnectException $e) {
|
||||||
$this->logger->logException($e, ['message' => 'Error while getting file info']);
|
$this->logger->logException($e, ['message' => 'Error while getting file info']);
|
||||||
throw new StorageNotAvailableException($e->getMessage(), $e->getCode(), $e);
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue