More throughout logging in PythonSdkUpdater
authorMikhail Golubev <mikhail.golubev@jetbrains.com>
Wed, 6 Jul 2016 11:19:55 +0000 (14:19 +0300)
committerMikhail Golubev <mikhail.golubev@jetbrains.com>
Thu, 7 Jul 2016 08:54:45 +0000 (11:54 +0300)
Add cause to the logged exception so that it's possible to see where
exactly SDK updating process was launched which is impossible at the
moment because of the nested backgroundable task and invokeLater().

python/src/com/jetbrains/python/sdk/PythonSdkUpdater.java

index e593af40baa9da394e359fcddff0e60e837b58db..edca9e70620fb6a96051c859f10787a1c92bd723 100644 (file)
@@ -133,6 +133,7 @@ public class PythonSdkUpdater implements StartupActivity {
       return true;
     }
 
+    @SuppressWarnings("ThrowableInstanceNeverThrown") final Throwable methodCallStacktrace = new Throwable();
     application.invokeLater(() -> {
       synchronized (ourLock) {
         if (!ourScheduledToRefresh.contains(homePath)) {
@@ -165,6 +166,7 @@ public class PythonSdkUpdater implements StartupActivity {
                   PyPackageManager.getInstance(sdk12).refreshAndGetPackages(true);
                 }
                 catch (ExecutionException e) {
+                  e.initCause(methodCallStacktrace);
                   LOG.warn(e);
                 }
               }