Repository navigation
Send the IDE plugin's errors to the JetBrains Marketplace - #199
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.xmlregisterscom.intellij.diagnostic.JetBrainsMarketplaceErrorReportSubmitteras the plugin'serrorHandler, 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.idea.fatal.error.notification=disabled. With that setting, the error indicator shows a plugin's error only when the plugin's submitter is not anITNReporter, or when the reporter'sshowErrorInReleasereturns true.JetBrainsMarketplaceErrorReportSubmitterextendsITNReporterand does not overrideshowErrorInRelease, 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.RuntimeExceptionbranch ofPalantirJavaFormatFormattingService, is nowlogger.error, so it goes into a report. The user still gets the plugin's own notification, which points toidea.log. AFormatterException, a syntax error in the user's file, is nowlogger.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 experimentalTrustedProjectsusages it reports were there before this PR.IdeErrorsDialog.getSubmitter(throwable, PluginId.getId("open-java-format"))returnsJetBrainsMarketplaceErrorReportSubmitterwith this plugin's descriptor, that its action is "Report to the Third-Party Plugin", and thatshowErrorInReleaseis false.Possible downsides?