Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ public void run() {
request.onTextReady(formattedText);
}
} catch (FormatterException e) {
logger.error(
// A syntax error in the file, not a fault of the plugin: an error would go to its error reports.
logger.warn(
String.format(
"Failed to format file %s",
request.getContext().getContainingFile().getName()),
Expand All @@ -163,8 +164,9 @@ public void run() {
throw e;
} catch (RuntimeException e) {
// Typically the formatter's JVM failing to start or exiting with an error. Left alone, the IDE
// swallows it and Reformat looks as if it did nothing.
logger.warn("open-java-format could not run the formatter", e);
// swallows it and Reformat looks as if it did nothing. An error rather than a warning, so that it goes
// to the plugin's error reports on the JetBrains Marketplace (see errorHandler in plugin.xml).
logger.error("open-java-format could not run the formatter", e);
request.onError(
Notifications.GENERIC_ERROR_NOTIFICATION_GROUP,
Notifications.formatterFailedMessage(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
<notificationGroup displayType="BALLOON" id="open-java-format parsing error"
isLogByDefault="false"/>
<notificationGroup displayType="STICKY_BALLOON" id="open-java-format native binary"/>
<!-- Errors the IDE traces to this plugin go to the Exceptions tab of its JetBrains Marketplace page. A release
IDE does not show them, as it does not show its own: the submitter is an ITNReporter, whose errors and
Report button only EAP builds show. From a release IDE a report goes only when the user lets the IDE send
error reports automatically, which 2024.2 cannot do. -->
<errorHandler implementation="com.intellij.diagnostic.JetBrainsMarketplaceErrorReportSubmitter"/>
</extensions>

</idea-plugin>
Loading