:error` with `{message, code}` so the client can translate the code. * Lives outside Controllers/ so the resolver never maps an event to it. */ abstract class GameController extends Controller { public $need_auth = true; protected function play(Closure $intent): mixed { try { return $intent(); } catch (GameRuleViolation $e) { return $this->error(['message' => $e->getMessage(), 'code' => $e->reason]); } } }