From 442db0170646f3b53de42d6a9e730541925cd9ab Mon Sep 17 00:00:00 2001 From: Arnout Engelen Date: Thu, 4 Jul 2019 10:35:09 +0200 Subject: [PATCH 1/2] Improve ToC roots check error message --- .../main/scala/com/lightbend/paradox/ParadoxProcessor.scala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/src/main/scala/com/lightbend/paradox/ParadoxProcessor.scala b/core/src/main/scala/com/lightbend/paradox/ParadoxProcessor.scala index 29addeb4..93e63a09 100644 --- a/core/src/main/scala/com/lightbend/paradox/ParadoxProcessor.scala +++ b/core/src/main/scala/com/lightbend/paradox/ParadoxProcessor.scala @@ -78,8 +78,10 @@ class ParadoxProcessor(reader: Reader = new Reader, writer: Writer = new Writer) } if (expectedRoots != roots.size) - throw new IllegalStateException(s"Expected $expectedRoots ToC roots (based on paradoxExpectedNumberOfRoots) but found ${roots.size}: " + - roots.map(_.label.path).mkString("[", ", ", "]")) + throw new IllegalStateException( + s"Found [${roots.size}] top-level pages (pages that do no have a parent in the Table of Contents), but expected [$expectedRoots].\n" + + S"If this is intentional, update the `paradoxExpectedNumberOfRoots` sbt setting to reflect the new expected number of roots.\n" + + "Current ToC roots: " + roots.map(_.label.path).mkString("[", ", ", "]")) outputDirectory.mkdirs() createMetadata(outputDirectory, properties) :: (roots flatMap { root => render(Some(root.location)) }) From 2593ff9cb0756ce34eee2e26bf37f6ab708960fc Mon Sep 17 00:00:00 2001 From: Arnout Engelen Date: Thu, 4 Jul 2019 11:54:46 +0200 Subject: [PATCH 2/2] use lowercase s --- .../src/main/scala/com/lightbend/paradox/ParadoxProcessor.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/scala/com/lightbend/paradox/ParadoxProcessor.scala b/core/src/main/scala/com/lightbend/paradox/ParadoxProcessor.scala index 93e63a09..e9055ee8 100644 --- a/core/src/main/scala/com/lightbend/paradox/ParadoxProcessor.scala +++ b/core/src/main/scala/com/lightbend/paradox/ParadoxProcessor.scala @@ -80,7 +80,7 @@ class ParadoxProcessor(reader: Reader = new Reader, writer: Writer = new Writer) if (expectedRoots != roots.size) throw new IllegalStateException( s"Found [${roots.size}] top-level pages (pages that do no have a parent in the Table of Contents), but expected [$expectedRoots].\n" + - S"If this is intentional, update the `paradoxExpectedNumberOfRoots` sbt setting to reflect the new expected number of roots.\n" + + s"If this is intentional, update the `paradoxExpectedNumberOfRoots` sbt setting to reflect the new expected number of roots.\n" + "Current ToC roots: " + roots.map(_.label.path).mkString("[", ", ", "]")) outputDirectory.mkdirs()