From 8786c7aab3d22ab02ad1a490927e70554fa31ab2 Mon Sep 17 00:00:00 2001 From: anna Date: Fri, 19 Nov 2010 19:49:20 +0300 Subject: [PATCH] process IndexNotReady gracefully (IDEA-54373) --- .../ex/GlobalInspectionContextImpl.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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 b85ca9b32fbd..44c60489aafa 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/ex/GlobalInspectionContextImpl.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/ex/GlobalInspectionContextImpl.java @@ -36,6 +36,8 @@ import com.intellij.openapi.progress.ProgressManager; import com.intellij.openapi.progress.Task; import com.intellij.openapi.progress.impl.ProgressManagerImpl; import com.intellij.openapi.progress.util.ProgressWrapper; +import com.intellij.openapi.project.DumbService; +import com.intellij.openapi.project.IndexNotReadyException; import com.intellij.openapi.project.Project; import com.intellij.openapi.project.ProjectUtil; import com.intellij.openapi.ui.Messages; @@ -459,6 +461,11 @@ public class GlobalInspectionContextImpl implements GlobalInspectionContext { cleanup((InspectionManagerEx)manager); throw e; } + catch (IndexNotReadyException e) { + cleanup((InspectionManagerEx)manager); + DumbService.getInstance(myProject).showDumbModeNotification("Usage search is not available until indices are ready"); + throw new ProcessCanceledException(); + } catch (Exception e) { LOG.error(e); } @@ -489,6 +496,9 @@ public class GlobalInspectionContextImpl implements GlobalInspectionContext { catch (ProcessCanceledException e) { throw e; } + catch (IndexNotReadyException e) { + throw e; + } catch (Exception e) { LOG.error(e); } @@ -501,6 +511,9 @@ public class GlobalInspectionContextImpl implements GlobalInspectionContext { catch (ProcessCanceledException e) { throw e; } + catch (IndexNotReadyException e) { + throw e; + } catch (Exception e) { LOG.error(e); } @@ -534,6 +547,9 @@ public class GlobalInspectionContextImpl implements GlobalInspectionContext { catch (ProcessCanceledException e) { throw e; } + catch (IndexNotReadyException e) { + throw e; + } catch (Exception e) { LOG.error(e); }