diff --git a/src/main/java/com/zhongan/devpilot/exception/DevPilotErrorReporter.java b/src/main/java/com/zhongan/devpilot/exception/DevPilotErrorReporter.java index 467530bf..0e9cd497 100644 --- a/src/main/java/com/zhongan/devpilot/exception/DevPilotErrorReporter.java +++ b/src/main/java/com/zhongan/devpilot/exception/DevPilotErrorReporter.java @@ -29,6 +29,7 @@ public class DevPilotErrorReporter extends ITNReporter { private final PluginId devpilotPluginId = PluginId.getId("com.zhongan.devPilot"); + private static final String READ_ACCESS_ERROR = "Read access is allowed from inside read-action (or EDT) only (see com.intellij.openapi.application.Application.runReadAction())"; /** * Ignore deprecated method error, in internal model, still receiver warning @@ -38,6 +39,7 @@ public class DevPilotErrorReporter extends ITNReporter { @Override public boolean showErrorInRelease(IdeaLoggingEvent event) { boolean isDevpilotDeprecatedUseNotice = false; + boolean isReadAccessError = false; Throwable t = event.getThrowable(); PluginId pluginId = PluginUtil.getInstance().findPluginId(t); if (Objects.equals(pluginId, devpilotPluginId)) { @@ -50,8 +52,11 @@ public boolean showErrorInRelease(IdeaLoggingEvent event) { } } } + if (StringUtils.containsIgnoreCase(t.getMessage(), READ_ACCESS_ERROR)) { + isReadAccessError = true; + } } - return !isDevpilotDeprecatedUseNotice; + return !isDevpilotDeprecatedUseNotice && !isReadAccessError; } @NotNull