Improve AI error reporting

This commit is contained in:
Thibault Duplessis 2012-04-01 18:10:45 +02:00
parent 528d04b732
commit 71966f6972
5 changed files with 5 additions and 5 deletions

View file

@ -14,7 +14,7 @@ trait Dependencies {
val specs2 = "org.specs2" %% "specs2" % "1.8.2"
val casbah = "com.mongodb.casbah" %% "casbah" % "2.1.5-1"
val salat = "com.novus" %% "salat-core" % "0.0.8-SNAPSHOT"
val scalalib = "com.github.ornicar" %% "scalalib" % "1.23"
val scalalib = "com.github.ornicar" %% "scalalib" % "1.24"
val hasher = "com.roundeights" % "hasher" % "0.3" from "http://cloud.github.com/downloads/Nycto/Hasher/hasher_2.9.1-0.3.jar"
val config = "com.typesafe.config" % "config" % "0.3.0"
val json = "com.codahale" %% "jerkson" % "0.5.0"

View file

@ -39,7 +39,7 @@ final class AppXhr(
_ finisher.moveFinish(g3, color)
} yield ()
else if (g3.player.isAi && g3.playable) for {
aiResult ai(g3) map (_.toOption err "AI failure")
aiResult ai(g3) map (_.err)
(newChessGame, move) = aiResult
g4 = g3.update(newChessGame, move)
_ save(g1, g4)

View file

@ -16,7 +16,7 @@ final class Starter(
_ if (game.variant == Standard) io() else gameRepo saveInitialFen game
_ addEntry(game, entryData)
g2 if (game.player.isHuman) io(game) else for {
aiResult ai(game) map (_.toOption err "AI failure")
aiResult ai(game) map (_.err)
(newChessGame, move) = aiResult
} yield game.update(newChessGame, move)
} yield g2

View file

@ -27,7 +27,7 @@ final class CraftyAi(
runCrafty(forsyth, dbGame.aiLevel | 1) map { newFen
for {
newSituation Forsyth << newFen toValid "Cannot parse engine FEN"
newSituation Forsyth << newFen toValid "Cannot parse engine FEN: " + newFen
reverseEngineer = new ReverseEngineering(oldGame, newSituation.board)
poss reverseEngineer.move toValid "Cannot reverse engineer engine move"
(orig, dest) = poss

2
todo
View file

@ -8,4 +8,4 @@ nicer not found in logs
In the chat room, the following message does not appear.
Rematch offer sent
Rematch offer accepted
promotion fail http://en.lichess.org/746qj8ip
seen in logs: lila.system.model.RawDbGame requires value for 'pgn'