diff --git a/src/server/lib/app/user.ex b/src/server/lib/app/user.ex index 63d24aa..0a7c93f 100644 --- a/src/server/lib/app/user.ex +++ b/src/server/lib/app/user.ex @@ -14,10 +14,12 @@ defmodule App.User do Logger.info("(#{user.id}): creating lobby") with lobby <- %App.Lobby.Schema{} |> DB.insert!(), - {:ok, {:global, lobby_id}} + {:ok, lobby_id} <- App.Supervisor.Lobbies.start_lobby(lobby) do Logger.info("(u#{user.id}): created lobby (#{lobby_id})") GenServer.reply(from, lobby_id) + else + e -> GenServer.reply(from, {:error, "failed to create lobby #{inspect(e)}"}) end end diff --git a/src/server/lib/app_web/router.ex b/src/server/lib/app_web/router.ex index e371d73..b40714f 100644 --- a/src/server/lib/app_web/router.ex +++ b/src/server/lib/app_web/router.ex @@ -39,6 +39,7 @@ defmodule AppWeb.Router do end # --- defp resp_actor(conn, actor) do + Logger.debug("(router): #{inspect(conn.body_params)}") try do resp_actor!(conn,actor) rescue @@ -53,9 +54,9 @@ defmodule AppWeb.Router do defp resp_actor!(conn, actor) do with {:ok, msg} <- parse_req_msg(conn), - reply <- unwrap!(GenServer.call(actor, msg, :infinity)) + reply <- unwrap!(GenServer.call(actor, msg)) do - Logger.debug("(router): #{inspect(msg)}") + Logger.debug("(router): #{inspect(msg)}") Logger.debug("(router): #{inspect(reply)}") conn |> put_resp_content_type("application/json")