Skip to content

Commit

Permalink
Add a newline delimiter to PlanCheck error message with multiple errors
Browse files Browse the repository at this point in the history
  • Loading branch information
neko-kai committed Feb 25, 2023
1 parent dc162d7 commit 8d19f0a
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ object MissingInstanceException {

val refRepr = target.tpe.tag.ref.render()

def formatRelevant(similar: Iterable[Binding], header: String) = {
def formatRelevant(similar: Iterable[Binding], header: String): Seq[String] = {
Option(similar)
.filterNot(_.isEmpty)
.map {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,6 @@ object PlanVerifier {

implicit class PlanIssueOps(private val issue: PlanIssue) extends AnyVal {
def render: String = {

issue match {
case i: UnsaturatedAxis =>
s"${i.key}: axis ${i.axis} has no bindings for choices ${i.missingAxisValues.mkString(", ")}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ object PlanCheck {

def returnPlanCheckError(cause: Either[Throwable, PlanVerifierResult.Incorrect]): PlanCheckResult.Incorrect = {
val visitedKeys = cause.fold(_ => Set.empty[DIKey], _.visitedKeys)
val errorMsg = cause.fold("\n" + _.stackTrace, _.issues.fromNonEmptySet.map(_.render).niceList())
val errorMsg = cause.fold("\n" + _.stackTrace, _.issues.fromNonEmptySet.map(_.render + "\n").niceList())
val message = {
val configStr = if (checkConfig) {
s"\n config = ${chosenConfig.fold("*")(c => s"resource:$c")} (effective: $effectiveConfig)"
Expand Down

0 comments on commit 8d19f0a

Please sign in to comment.