neurodynamic
I’ve been trying to use the {msg, opts} tuple variant of the :message option in validate_format, taking a validation that looked like this:
|> validate_format(:field, ~r/some_regex/, message: "oh no!")
to this
|> validate_format(:field, ~r/some_regex/, message: {"oh no!", [error_type: :some_error_type]})
but when I do, I start to get errors that look like this in my validation code:
** (EXIT from #PID<0.2412.0>) an exception was raised:
** (FunctionClauseError) no function clause matching in anonymous fn/1 in Ecto.Changeset.validate_change/3
The following arguments were given to anonymous fn/1 in Ecto.Changeset.validate_change/3:
# 1
{:field, {{"oh no!", [error_type: :some_error_type]}, [validation: :format]}}
stacktrace:
(ecto 3.11.2) lib/ecto/changeset.ex:2430: anonymous fn/1 in Ecto.Changeset.validate_change/3
(elixir 1.16.2) lib/enum.ex:1700: Enum."-map/2-lists^map/1-1-"/2
(ecto 3.11.2) lib/ecto/changeset.ex:2430: Ecto.Changeset.validate_change/3
Am I misunderstanding how the tuple variant for the :message option is supposed to look? I can’t figure out why this error is happening.
Trending in Questions
Hello!
Suppose you are building workflow (order / task / payment) processing system with the following requirements:
Each workflow con...
New
Hi all,
I’m working on a Phoenix project where I need to make external HTTP requests and I’m trying to choose between Req and HTTPoison....
New
How do I tell Hologram not to escape HTML when substituting into templates?
{Textile.render(@product.long_description)}
escapes the HTM...
New
Hi,
we run different LLM models across a cluster, with each node loading a configurable subset. Model-specific queues let nodes consume ...
New
I’d like to create a file with 600 permissions (rw-------), but there’s a race condition if I create it and then change the permissions. ...
New
Is there a way to import record definitions in the iex shell for pretty printing (similar to the rr command in the erl shell)? This woul...
New
When I use Mix.install with a git dependency, using git@github.com:... how do I change the SSH identity used?
I’ve got two Github accoun...
New
Other Trending Topics
Hey there,
I haven’t seen a list of useful Elixir specific skills for the popular AI tools yet so I’m starting one here with my first.
...
New
Hi everyone :waving_hand:
I wanted to share something I’ve been building — NowBlind, a random chat app designed to help people discover ...
New
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
(I just needed to vent somewhere and LinkedIn is full of hope, or hype, I’m not sure which exactly)
AI dream has many faces, but general...
New
Localize is the next generation localisation library for Elixir. Think of it as ex_cldr version 3.0. The first version will be released ...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #code-sync
- #discussion
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #ai
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #elixirconf-us
- #blog-post
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #elixirconf-eu
- #processes
- #security
- #api
- #forms
- #performance











Showing Posts 1 to 2- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
fuelen
Update ecto
This option is available since v3.12.0
neurodynamic
Ah! Thank you!