Skip to content

Send the IDE plugin's errors to the JetBrains Marketplace - #199

Merged
abashev merged 1 commit into
21.X.Xfrom
abashev/Report-for-exceptions
Nov 8, 2026
Merged

abashev merged 1 commit into
21.X.Xfrom
abashev/Report-for-exceptions

Conversation

@abashev

@abashev abashev commented Nov 8, 2026

Copy link
Copy Markdown
Collaborator

Before this PR

When the IDE plugin failed, nobody could tell us. The IDE puts an error down to a plugin when its stack trace runs through the plugin's classes, and offers Report only for a plugin that names an error handler. This one named none, so the IDE Internal Errors dialog showed the plugin's errors with Report switched off. The error that mattered most did not reach that dialog at all: the formatter failing to run, its process not starting or exiting with an error, was logged as a warning.

After this PR

==COMMIT_MSG==
The IDE plugin sends its errors to the Exceptions tab of its page on the JetBrains Marketplace, with the OS, the IDE's and the plugin's versions and the full stack trace. A release IDE sends them only when the user lets it send error reports automatically, and no longer shows them to the user; EAP builds show them with Report.
==COMMIT_MSG==

  • plugin.xml registers com.intellij.diagnostic.JetBrainsMarketplaceErrorReportSubmitter as the plugin's errorHandler, as the Marketplace docs describe. The class has been in the platform since 2023.3, so 2024.2, the oldest IDE the plugin supports, has it.
  • What a release IDE does with it, read from the bytecode of IC-242.26775.15 and IU-263.7307.200. A release IDE sets idea.fatal.error.notification=disabled. With that setting, the error indicator shows a plugin's error only when the plugin's submitter is not an ITNReporter, or when the reporter's showErrorInRelease returns true. JetBrainsMarketplaceErrorReportSubmitter extends ITNReporter and does not override showErrorInRelease, which returns false. A report from a release IDE is sent automatically, without a dialog. The automatic sending (ExceptionAutoReportUtil) checks for this exact class, so a subclass that showed the errors would not get it, and IC-242 has no automatic sending at all.
  • Logging: the formatter failing to run, the RuntimeException branch of PalantirJavaFormatFormattingService, is now logger.error, so it goes into a report. The user still gets the plugin's own notification, which points to idea.log. A FormatterException, a syntax error in the user's file, is now logger.warn, so it does not fill the reports. Neither formatter the plugin runs throws it today: both return no replacements on a syntax error.

How it was checked

  • ./gradlew :open-java-format-idea-plugin:test: 64 tests, all pass.
  • ./gradlew :open-java-format-idea-plugin:verifyPlugin: compatible with IC-242 and IU-263. The deprecated and experimental TrustedProjects usages it reports were there before this PR.
  • A throwaway test, not committed, ran in the plugin's test IDE (IC-242). It confirmed that IdeErrorsDialog.getSubmitter(throwable, PluginId.getId("open-java-format")) returns JetBrainsMarketplaceErrorReportSubmitter with this plugin's descriptor, that its action is "Report to the Third-Party Plugin", and that showErrorInRelease is false.

Possible downsides?

  • In a release IDE users no longer see the red indicator for this plugin's errors, which they saw before, Report switched off. When the formatter fails to run, they still get the plugin's notification.
  • Reports arrive only from users who let the IDE send error reports automatically, and from EAP builds; none arrive from release 2024.2. A user cannot attach a comment or a way to reach them, since the dialog does not open in a release IDE.
  • A formatter that fails on every Reformat, such as a build classpath the formatter cannot run, now logs an error each time. The Marketplace groups them as one issue.

The IDE puts an error down to the plugin when its stack trace runs
through the plugin's classes, and the plugin named no error handler, so
nothing could report one. It now names
JetBrainsMarketplaceErrorReportSubmitter, and the reports go to the
Exceptions tab of the plugin's page on the JetBrains Marketplace.

That submitter is an ITNReporter, whose errors a release IDE does not
show, as it does not show its own: the red indicator and Report appear
only in EAP builds. From a release IDE a report goes only when the user
lets the IDE send error reports automatically, which 2024.2 cannot do.

The formatter failing to run, the error worth reporting, was logged as
a warning and so never reached a report; it is an error now. A syntax
error in the file is a warning now: it is the user's, not the plugin's.
@abashev
abashev merged commit f2baf3d into 21.X.X Nov 8, 2026
35 of 39 checks passed
@abashev
abashev deleted the abashev/Report-for-exceptions branch November 8, 2026 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant