Skip to content

Commit 30ce3c2

Browse files
committed
Make sure that project does not hang in case of errors
1 parent fb8e7f6 commit 30ce3c2

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

scala3doc/src/dotty/dokka/Scala3docArgs.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ object Scala3docArgs:
7676
)
7777

7878
def defaultDest(): File =
79-
report.error("Destenation is missing, please provide '-d' parameter poitning to director here docs should be created")
79+
report.error("Destenation is missing, please provide '-d' parameter pointing to directory here docs should be created")
8080
File("output")
8181

8282
val parseSyntax = syntax.nonDefault.fold(CommentSyntax.default){ str =>

scala3doc/src/dotty/dokka/site/StaticSiteLocationProvider.scala

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,15 @@ import java.nio.file.Path
1515

1616
class StaticSiteLocationProviderFactory(private val ctx: DokkaContext) extends LocationProviderFactory:
1717
override def getLocationProvider(pageNode: RootPageNode): LocationProvider =
18-
new StaticSiteLocationProvider(ctx, pageNode)
18+
try new StaticSiteLocationProvider(ctx, pageNode)
19+
catch
20+
case e: Error =>
21+
// TODO (https://github.com/lampepfl/scala3doc/issues/238) error handling
22+
e.printStackTrace()
23+
// We encounter bug in Kotlin coroutines (race) when this method throws exception
24+
// In such case we want to return null to trigger NPE in other piece of code to fail properly coroutine context
25+
// Making generated DRIs not-unique will reproduce this behavior
26+
null
1927

2028
class StaticSiteLocationProvider(ctx: DokkaContext, pageNode: RootPageNode)
2129
extends DokkaLocationProvider(pageNode, ctx, ".html"):

0 commit comments

Comments
 (0)