Skip to content

Commit 7d9d0de

Browse files
committed
Make sure that project does not hang in case of errors
1 parent 54e7c74 commit 7d9d0de

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
@@ -13,7 +13,15 @@ import scala.collection.JavaConverters._
1313

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

1826
class StaticSiteLocationProvider(ctx: DokkaContext, pageNode: RootPageNode)
1927
extends DokkaLocationProvider(pageNode, ctx, ".html"):

0 commit comments

Comments
 (0)