Current section

Files

Jump to
islands_client_summary lib islands client summary message error.ex
Raw

lib/islands/client/summary/message/error.ex

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