diff --git a/src/main/java/io/github/linwancen/plugin/show/cache/LineEndCacheUtils.java b/src/main/java/io/github/linwancen/plugin/show/cache/LineEndCacheUtils.java index 54fdb22..803a379 100644 --- a/src/main/java/io/github/linwancen/plugin/show/cache/LineEndCacheUtils.java +++ b/src/main/java/io/github/linwancen/plugin/show/cache/LineEndCacheUtils.java @@ -79,7 +79,7 @@ public class LineEndCacheUtils { AppExecutorUtil.getAppScheduledExecutorService().scheduleWithFixedDelay(() -> { try { cacheUpdate(); - } catch (Exception e) { + } catch (Throwable e) { LOG.info("LineEndCacheUtils checkScheduleAndInit catch Throwable but log to record.", e); } }, 0L, 1L, TimeUnit.SECONDS); @@ -130,15 +130,18 @@ public class LineEndCacheUtils { lineCache.updated(); } catch (ProcessCanceledException ignore) { // ignore - } catch (Exception e) { - LOG.info("LineEndCacheUtils lineMap.forEach catch Throwable but log to record.", e); + } catch (Throwable e) { + @Nullable String msg = e.getMessage(); + if (msg == null || !msg.contains("File is not valid")) { + LOG.info("LineEndCacheUtils lineMap.forEach catch Throwable but log to record.", e); + } } }).inSmartMode(project).executeSynchronously(); })); } catch (IllegalStateException ignore) { // ignore inSmartMode(project) throw: // @NotNull method com/intellij/openapi/project/impl/ProjectImpl.getEarlyDisposable must not return null - } catch (Exception e) { + } catch (Throwable e) { LOG.info("LineEndCacheUtils cache.forEach catch Throwable but log to record.", e); } }); diff --git a/src/main/java/io/github/linwancen/plugin/show/cache/TreeCacheUtils.java b/src/main/java/io/github/linwancen/plugin/show/cache/TreeCacheUtils.java index 65bbab4..753fc25 100644 --- a/src/main/java/io/github/linwancen/plugin/show/cache/TreeCacheUtils.java +++ b/src/main/java/io/github/linwancen/plugin/show/cache/TreeCacheUtils.java @@ -54,7 +54,7 @@ public class TreeCacheUtils { AppExecutorUtil.getAppScheduledExecutorService().scheduleWithFixedDelay(() -> { try { cacheUpdate(); - } catch (Exception e) { + } catch (Throwable e) { LOG.info("TreeCacheUtils checkScheduleAndInit catch Throwable but log to record.", e); } }, 0L, 1L, TimeUnit.SECONDS); @@ -81,7 +81,7 @@ public class TreeCacheUtils { treeCache.needUpdate = false; } catch (ProcessCanceledException ignore) { // ignore - } catch (Exception e) { + } catch (Throwable e) { LOG.info("TreeCacheUtils nodeCache.forEach catch Throwable but log to record.", e); } }).inSmartMode(project).executeSynchronously(); @@ -90,7 +90,7 @@ public class TreeCacheUtils { } catch (IllegalStateException ignore) { // ignore inSmartMode(project) throw: // @NotNull method com/intellij/openapi/project/impl/ProjectImpl.getEarlyDisposable must not return null - } catch (Exception e) { + } catch (Throwable e) { LOG.info("TreeCacheUtils cache.forEach catch Throwable but log to record.", e); } });