fix bot move validation
parent
5e669b260b
commit
c589540cc3
|
@ -109,7 +109,7 @@ final class PlayApi(
|
|||
|
||||
private def toResult(f: Funit): Fu[Result] = catchClientError(f inject jsonOkResult)
|
||||
private def catchClientError(f: Fu[Result]): Fu[Result] = f recover {
|
||||
case e: lila.base.ClientError => BadRequest(jsonError(e.getMessage))
|
||||
case e: lila.round.BenignError => BadRequest(jsonError(e.getMessage))
|
||||
}
|
||||
|
||||
private def WithPovAsBot(anyId: String, me: lila.user.User)(f: Pov => Fu[Result]) =
|
||||
|
|
|
@ -18,7 +18,7 @@ final class BotPlayer(
|
|||
isOfferingRematch: lila.round.IsOfferingRematch
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: akka.actor.ActorSystem) {
|
||||
|
||||
private def clientError[A](msg: String): Fu[A] = fufail(lila.base.LilaException.client(msg))
|
||||
private def clientError[A](msg: String): Fu[A] = fufail(lila.round.ClientError(msg))
|
||||
|
||||
def apply(pov: Pov, me: User, uciStr: String, offeringDraw: Option[Boolean]): Funit =
|
||||
lila.common.Future.delay((pov.game.hasAi ?? 500) millis) {
|
||||
|
|
|
@ -9,8 +9,6 @@ trait LilaException extends Exception {
|
|||
override def toString = message
|
||||
}
|
||||
|
||||
trait ClientError extends LilaException
|
||||
|
||||
object LilaException extends scalaz.syntax.ToShowOps {
|
||||
|
||||
def apply(msg: String) = new LilaException {
|
||||
|
@ -18,8 +16,4 @@ object LilaException extends scalaz.syntax.ToShowOps {
|
|||
}
|
||||
|
||||
def apply(msg: Failures): LilaException = apply(msg.shows)
|
||||
|
||||
def client(msg: String) = new ClientError {
|
||||
val message = msg
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,9 +11,9 @@ package object round extends PackageObject {
|
|||
|
||||
package round {
|
||||
|
||||
sealed private[round] trait BenignError extends lila.base.LilaException
|
||||
private[round] case class ClientError(message: String) extends BenignError
|
||||
private[round] case class FishnetError(message: String) extends BenignError
|
||||
trait BenignError extends lila.base.LilaException
|
||||
case class ClientError(message: String) extends BenignError
|
||||
case class FishnetError(message: String) extends BenignError
|
||||
|
||||
sealed trait OnTv
|
||||
|
||||
|
|
Loading…
Reference in New Issue