From 50ccf304f11eb4fc928746a99be2a43f88096a0a Mon Sep 17 00:00:00 2001 From: Kacper Korban Date: Mon, 4 Nov 2024 15:23:25 +0100 Subject: [PATCH 1/3] Don't point to the compiler backlog when a compiler plugin phase crashes --- compiler/src/dotty/tools/dotc/report.scala | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/report.scala b/compiler/src/dotty/tools/dotc/report.scala index e24e6be38b2b..2eca09380b5d 100644 --- a/compiler/src/dotty/tools/dotc/report.scala +++ b/compiler/src/dotty/tools/dotc/report.scala @@ -165,13 +165,23 @@ object report: "compiler version" -> dotty.tools.dotc.config.Properties.versionString, "settings" -> settings.map(showSetting).mkString(" "), )) + val fileAReportMsg = + if ctx.phase.isInstanceOf[plugins.PluginPhase] + then + s"""| Please file a crash report in the compiler plugin backlog. + | The name of the compiler plugin which caused the crash is "${ctx.phase.megaPhase}". + | For non-enriched exceptions, compile with -Xno-enrich-error-messages. + |""".stripMargin + else + s"""| Please file a crash report here: + | https://github.com/scala/scala3/issues/new/choose + | For non-enriched exceptions, compile with -Xno-enrich-error-messages. + |""".stripMargin s""" | $errorMessage | | An unhandled exception was thrown in the compiler. - | Please file a crash report here: - | https://github.com/scala/scala3/issues/new/choose - | For non-enriched exceptions, compile with -Xno-enrich-error-messages. + |$fileAReportMsg | |$info1 |""".stripMargin From b5a0e51ea6195d8a8e128a4af4259f4dcfab9530 Mon Sep 17 00:00:00 2001 From: Kacper Korban Date: Mon, 4 Nov 2024 17:03:37 +0100 Subject: [PATCH 2/3] Update the crash report message --- compiler/src/dotty/tools/dotc/report.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/report.scala b/compiler/src/dotty/tools/dotc/report.scala index 2eca09380b5d..ace23a126395 100644 --- a/compiler/src/dotty/tools/dotc/report.scala +++ b/compiler/src/dotty/tools/dotc/report.scala @@ -168,19 +168,19 @@ object report: val fileAReportMsg = if ctx.phase.isInstanceOf[plugins.PluginPhase] then - s"""| Please file a crash report in the compiler plugin backlog. - | The name of the compiler plugin which caused the crash is "${ctx.phase.megaPhase}". + s"""| An unhandled exception was thrown in the compiler plugin named "${ctx.phase.megaPhase}". + | Please file a crash report in the compiler plugin backlog. | For non-enriched exceptions, compile with -Xno-enrich-error-messages. |""".stripMargin else - s"""| Please file a crash report here: + s"""| An unhandled exception was thrown in the compiler. + | Please file a crash report here: | https://github.com/scala/scala3/issues/new/choose | For non-enriched exceptions, compile with -Xno-enrich-error-messages. |""".stripMargin s""" | $errorMessage | - | An unhandled exception was thrown in the compiler. |$fileAReportMsg | |$info1 From d5ff3ffce0b6103a8677b116c1fe998131db53f1 Mon Sep 17 00:00:00 2001 From: Kacper Korban Date: Tue, 5 Nov 2024 20:57:52 +0100 Subject: [PATCH 3/3] Update the crash report message --- compiler/src/dotty/tools/dotc/report.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/src/dotty/tools/dotc/report.scala b/compiler/src/dotty/tools/dotc/report.scala index ace23a126395..2ccf918e12fa 100644 --- a/compiler/src/dotty/tools/dotc/report.scala +++ b/compiler/src/dotty/tools/dotc/report.scala @@ -169,7 +169,7 @@ object report: if ctx.phase.isInstanceOf[plugins.PluginPhase] then s"""| An unhandled exception was thrown in the compiler plugin named "${ctx.phase.megaPhase}". - | Please file a crash report in the compiler plugin backlog. + | Please report the issue to the plugin's maintainers. | For non-enriched exceptions, compile with -Xno-enrich-error-messages. |""".stripMargin else