Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve ToC roots check error message #334

Merged
merged 2 commits into from
Jul 4, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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)) })
Expand Down