Skip to content

Commit 8f85719

Browse files
KacperFKorbantgodzik
authored andcommitted
Don't point to the compiler backlog when a compiler plugin phase crashes (scala#21887)
closes scala#21783
1 parent d41b267 commit 8f85719

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

compiler/src/dotty/tools/dotc/report.scala

+14-4
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,23 @@ object report:
152152
"compiler version" -> dotty.tools.dotc.config.Properties.versionString,
153153
"settings" -> settings.map(showSetting).mkString(" "),
154154
))
155+
val fileAReportMsg =
156+
if ctx.phase.isInstanceOf[plugins.PluginPhase]
157+
then
158+
s"""| An unhandled exception was thrown in the compiler plugin named "${ctx.phase.megaPhase}".
159+
| Please report the issue to the plugin's maintainers.
160+
| For non-enriched exceptions, compile with -Xno-enrich-error-messages.
161+
|""".stripMargin
162+
else
163+
s"""| An unhandled exception was thrown in the compiler.
164+
| Please file a crash report here:
165+
| https://github.com/scala/scala3/issues/new/choose
166+
| For non-enriched exceptions, compile with -Xno-enrich-error-messages.
167+
|""".stripMargin
155168
s"""
156169
| $errorMessage
157170
|
158-
| An unhandled exception was thrown in the compiler.
159-
| Please file a crash report here:
160-
| https://github.com/lampepfl/dotty/issues/new/choose
161-
| For non-enriched exceptions, compile with -Yno-enrich-error-messages.
171+
|$fileAReportMsg
162172
|
163173
|$info1
164174
|""".stripMargin

0 commit comments

Comments
 (0)