If I use errors: [{"keywords", "error msg"}]
I end up with the following big error message in the console:
[error] GenServer #PID<0.959.0> terminating
** (FunctionClauseError) no function clause matching in BrandableDomainsWeb.CoreComponents.translate_error/1
(brandable_domains 0.1.0) lib/brandable_domains_web/components/core_components.ex:652: BrandableDomainsWeb.CoreComponents.translate_error("Keywords can only contain lowercase letters, uppercase letters, and numbers")
(elixir 1.17.1) lib/enum.ex:1703: Enum."-map/2-lists^map/1-1-"/2
(brandable_domains 0.1.0) lib/brandable_domains_web/components/core_components.ex:299: BrandableDomainsWeb.CoreComponents."input (overridable 1)"/1
(phoenix_live_view 1.0.0-rc.6) lib/phoenix_live_view/tag_engine.ex:92: Phoenix.LiveView.TagEngine.component/3
(brandable_domains 0.1.0) lib/brandable_domains_web/live/generate_domains_live.html.heex:9: anonymous fn/3 in BrandableDomainsWeb.GenerateDomainsLive.render/1
(phoenix_live_view 1.0.0-rc.6) lib/phoenix_live_view/diff.ex:368: Phoenix.LiveView.Diff.traverse/7
(phoenix_live_view 1.0.0-rc.6) lib/phoenix_live_view/diff.ex:532: anonymous fn/4 in Phoenix.LiveView.Diff.traverse_dynamic/7
(elixir 1.17.1) lib/enum.ex:2531: Enum."-reduce/3-lists^foldl/2-0-"/3
(phoenix_live_view 1.0.0-rc.6) lib/phoenix_live_view/diff.ex:366: Phoenix.LiveView.Diff.traverse/7
(phoenix_live_view 1.0.0-rc.6) lib/phoenix_live_view/diff.ex:532: anonymous fn/4 in Phoenix.LiveView.Diff.traverse_dynamic/7
(elixir 1.17.1) lib/enum.ex:2531: Enum."-reduce/3-lists^foldl/2-0-"/3
(phoenix_live_view 1.0.0-rc.6) lib/phoenix_live_view/diff.ex:366: Phoenix.LiveView.Diff.traverse/7
(phoenix_live_view 1.0.0-rc.6) lib/phoenix_live_view/diff.ex:532: anonymous fn/4 in Phoenix.LiveView.Diff.traverse_dynamic/7
(elixir 1.17.1) lib/enum.ex:2531: Enum."-reduce/3-lists^foldl/2-0-"/3
(phoenix_live_view 1.0.0-rc.6) lib/phoenix_live_view/diff.ex:366: Phoenix.LiveView.Diff.traverse/7
(phoenix_live_view 1.0.0-rc.6) lib/phoenix_live_view/diff.ex:532: anonymous fn/4 in Phoenix.LiveView.Diff.traverse_dynamic/7
(elixir 1.17.1) lib/enum.ex:2531: Enum."-reduce/3-lists^foldl/2-0-"/3
(phoenix_live_view 1.0.0-rc.6) lib/phoenix_live_view/diff.ex:366: Phoenix.LiveView.Diff.traverse/7
(phoenix_live_view 1.0.0-rc.6) lib/phoenix_live_view/diff.ex:532: anonymous fn/4 in Phoenix.LiveView.Diff.traverse_dynamic/7
(elixir 1.17.1) lib/enum.ex:2531: Enum."-reduce/3-lists^foldl/2-0-"/3
Last message: %Phoenix.Socket.Message{topic: "lv:phx-F-SY-Ni1nwaI7QND", event: "event", payload: %{"event" => "validate_domains", "type" => "form", "uploads" => %{}, "value" => "_unused_keywords=&keywords=%21&_unused_extensions=&extensions=&_target=keywords"}, ref: "14", join_ref: "13"}
State: %{socket: #Phoenix.LiveView.Socket<id: "phx-F-SY-Ni1nwaI7QND", endpoint: BrandableDomainsWeb.Endpoint, view: BrandableDomainsWeb.GenerateDomainsLive, parent_pid: nil, root_pid: #PID<0.959.0>, router: BrandableDomainsWeb.Router, assigns: %{form: %Phoenix.HTML.Form{source: %{"extensions" => "", "keywords" => ""}, impl: Phoenix.HTML.FormData.Map, id: nil, name: nil, data: %{}, action: nil, hidden: [], params: %{"extensions" => "", "keywords" => ""}, errors: [], options: [], index: nil}, __changed__: %{}, current_user: nil, flash: %{}, live_action: nil}, transport_pid: #PID<0.943.0>, ...>, components: {%{}, %{}, 1}, topic: "lv:phx-F-SY-Ni1nwaI7QND", serializer: Phoenix.Socket.V2.JSONSerializer, join_ref: "13", upload_names: %{}, upload_pids: %{}}
Just for the sake of brevity here is the output from IO.inspect(form)
:
%Phoenix.HTML.Form{
source: %{"extensions" => "", "keywords" => "!"},
impl: Phoenix.HTML.FormData.Map,
id: nil,
name: nil,
data: %{},
action: nil,
hidden: [],
params: %{"extensions" => "", "keywords" => "!"},
errors: [
{"keywords",
"Keywords can only contain lowercase letters, uppercase letters, and numbers"}
],
options: [],
index: nil
}