@dkuku.bsky.social
Puzzles: The Witness
Story: Outer Wilds
April 12, 2025 at 6:49 PM
Looking at the error and comparing this particular error from ash to ecto exceptions - in ecto there is always the message field. This way the error is always included, even if you see the raw struct.
github.com/elixir-ecto/...
ecto/lib/ecto/exceptions.ex at master · elixir-ecto/ecto
A toolkit for data mapping and language integrated query. - elixir-ecto/ecto
github.com
January 14, 2025 at 9:15 PM
If only the string `attribute name is required` was included somewhere in the error struct it would be enough for me to spot it.
January 14, 2025 at 8:45 PM
This would still be a problem when using `with` syntax where ok tuples are used often for control flow. Now I know the issue and i can work around it, but seeing it the first time in red in failed test makes me think that something is still missing.
January 14, 2025 at 8:33 PM
When I pipe it to IO.puts then it's obvious but for starters it's not obvious. If the `attribute name is requried` would be included in the error struct somewhere I would spot it:
January 14, 2025 at 8:18 PM
@zachdaniel.dev
The cryptic message I mentioned was just the Ash.Invalid.Error struct. It contains the error but when it's not pretty printed then it's really hard to guess what's going on. Ecto for comparison has the error string in changeset, Ash generates from the struct - and it's missing here.
January 14, 2025 at 8:11 PM
That being said I look forward to getting the book
January 12, 2025 at 4:44 PM
Since Phoenix generators create test files automatically, you might want to consider adding something similar to help developers get started.
January 12, 2025 at 4:42 PM
My usual approach is to start with a test and let the compiler errors guide me. However, in this case, the errors were so cryptic that I had to abandon the effort. The ash_hq and realworld examples have very few tests, which doesn't help.
January 12, 2025 at 4:41 PM
I appreciate the community's help, but when I get stuck on basic concepts, I know I'll struggle even more with advanced topics. One major blocker was the lack of test examples. While there is a page in the documentation about testing, it doesn't cover important areas like relationships.
January 12, 2025 at 4:41 PM
I think that you should record someone with elixir knowledge but without ash experience trying to copy something in ash and see where they struggle. Similary what Primeagen did when learning elixir.
January 12, 2025 at 12:22 PM
Every time I try to start with ash, I get stuck. I tried with tdd which is very easy in phoenix or rails because the error often guides you what to do next. With ash it's not that obvious.
January 12, 2025 at 12:22 PM