Skip to content

Commit

Permalink
Merge pull request #6982 from davidegrohmann/3.0-improve-error-msg
Browse files Browse the repository at this point in the history
Improve exception message
  • Loading branch information
craigtaverner committed Apr 20, 2016
2 parents 6a34a41 + cc5512c commit 299453b
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@ class IDPSolver[Solvable, Result, Context](generator: IDPSolverStep[Solvable, Re
def findBestCandidateInBlock(blockSize: Int): (Goal, Result) = {
val blockCandidates: Iterable[(Goal, Result)] = LazyIterable(table.plansOfSize(blockSize)).toSeq
val bestInBlock = goalSelector(blockCandidates)
bestInBlock.getOrElse(throw new IllegalStateException("Found no solution for block"))
bestInBlock.getOrElse {
throw new IllegalStateException(
s"""Found no solution for block with size $blockSize,
|$blockCandidates were the selected candidates from the table $table""".stripMargin)
}
}

def compactBlock(original: Goal, candidate: Result): Unit = {
Expand Down

0 comments on commit 299453b

Please sign in to comment.