PY-26298 EA-107209 Return empty list in case of exception instead of null

It's not the best idea to suppress exceptions (logged) like that, but
PyPackageManager itself works this way at the moment by caching an empty
list of packages after the first error. It also releases the clients of
refreshAndGetPackages() of burden of handling these (presumably rare)
exceptions on their own.
This commit is contained in:
Mikhail Golubev
2017-10-02 21:33:42 +03:00
parent f32be2e295
commit 5b9c94fa3e
@@ -308,6 +308,7 @@ public class PyPackageUtil {
packagesRef.set(manager.refreshAndGetPackages(false));
}
catch (ExecutionException e) {
packagesRef.set(Collections.emptyList());
if (LOG.isDebugEnabled()) {
e.initCause(callStacktrace);
LOG.debug(e);