Throw connection errors in some extra cases

This commit is contained in:
Juan Pablo Villafañez 2014-07-24 17:29:02 +02:00 committed by Robin Appelman
commit 8f8f8cbf5e

View file

@ -98,6 +98,13 @@ class NativeShare implements IShare {
throw new InvalidHostException($errorString);
} else if (strpos($errorString, 'Permission denied')) {
throw new AccessDeniedException($errorString);
} else if (strpos($errorString, 'unknown error (110)') or
strpos($errorString, 'unknown error (111)') or
strpos($errorString, 'unknown error (112)') or
strpos($errorString, 'unknown error (113)')) {
// errors for connection timeout, connection refused, host is down and
// no route to host, respectively
throw new ConnectionError($errorString);
} else {
throw new \Exception($errorString);
}