From 853ed310011536ef9658d9dcc3d7e9cea47bb97e Mon Sep 17 00:00:00 2001 From: anna Date: Thu, 25 Jul 2013 13:41:53 +0200 Subject: [PATCH] do not log throwable when rethrow is more likely to be expected (IDEA-110920) --- .../codeInspection/ex/GlobalInspectionContextImpl.java | 7 ++++++- .../src/com/intellij/concurrency/JobLauncherImpl.java | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/codeInspection/ex/GlobalInspectionContextImpl.java b/platform/lang-impl/src/com/intellij/codeInspection/ex/GlobalInspectionContextImpl.java index 2b68e196ff36..f53380e69c4c 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/ex/GlobalInspectionContextImpl.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/ex/GlobalInspectionContextImpl.java @@ -365,7 +365,12 @@ public class GlobalInspectionContextImpl extends GlobalInspectionContextBase imp }); } catch (ProcessCanceledException e) { - throw e; + final Throwable cause = e.getCause(); + if (cause != null) { + LOG.error("In file: " + file, cause); + } else { + throw e; + } } catch (IndexNotReadyException e) { throw e; diff --git a/platform/platform-impl/src/com/intellij/concurrency/JobLauncherImpl.java b/platform/platform-impl/src/com/intellij/concurrency/JobLauncherImpl.java index cd6fb24a4184..8a0d01c8b5dd 100644 --- a/platform/platform-impl/src/com/intellij/concurrency/JobLauncherImpl.java +++ b/platform/platform-impl/src/com/intellij/concurrency/JobLauncherImpl.java @@ -70,7 +70,7 @@ public class JobLauncherImpl extends JobLauncher { } catch (Throwable throwable) { job.cancel(); - LOG.error(throwable); + throw new ProcessCanceledException(throwable); } return !job.isCanceled(); }