refactor: update assertGameNotOver to use proper syntax and improve readability
This commit is contained in:
@@ -125,8 +125,10 @@ class GameResource:
|
|||||||
private def ok(body: AnyRef): Response = Response.ok(body).build()
|
private def ok(body: AnyRef): Response = Response.ok(body).build()
|
||||||
private def created(body: AnyRef): Response = Response.status(Response.Status.CREATED).entity(body).build()
|
private def created(body: AnyRef): Response = Response.status(Response.Status.CREATED).entity(body).build()
|
||||||
|
|
||||||
|
// scalafix:off DisableSyntax.throw
|
||||||
private def assertGameNotOver(entry: GameEntry): Unit =
|
private def assertGameNotOver(entry: GameEntry): Unit =
|
||||||
if entry.engine.context.result.isDefined then throw BadRequestException("GAME_OVER", "Game is already over")
|
if entry.engine.context.result.isDefined then throw BadRequestException("GAME_OVER", "Game is already over")
|
||||||
|
// scalafix:on DisableSyntax.throw
|
||||||
|
|
||||||
// ── endpoints ────────────────────────────────────────────────────────────
|
// ── endpoints ────────────────────────────────────────────────────────────
|
||||||
// scalafix:off DisableSyntax.throw
|
// scalafix:off DisableSyntax.throw
|
||||||
|
|||||||
Reference in New Issue
Block a user