Current section

Files

Jump to
islands_tally lib islands message error.ex
Raw

lib/islands/message/error.ex

defmodule Islands.Tally.Message.Error do
alias IO.ANSI.Plus, as: ANSI
alias Islands.{PlayerID, Tally}
@spec message(PlayerID.t(), Tally.t()) :: ANSI.ansilist()
def message(_player_id, %Tally{response: {:error, reason}}) do
[
:free_speech_red_background,
:light_white,
"ERROR: #{Atom.to_string(reason) |> String.replace("_", " ")}."
]
end
end