You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
** (FunctionClauseError) no function clause matching in anonymous fn/1 in Mix.Tasks.Ash.Gen.Resource.attribute_modifier_string/1
The following arguments were given to anonymous fn/1 in Mix.Tasks.Ash.Gen.Resource.attribute_modifier_string/1:
# 1
"optional"
(ash 3.4.35) lib/mix/tasks/gen/ash.gen.resource.ex:303: anonymous fn/1 in Mix.Tasks.Ash.Gen.Resource.attribute_modifier_string/1
(elixir 1.17.2) lib/enum.ex:1804: anonymous fn/2 in Enum.map_join/3
(elixir 1.17.2) lib/enum.ex:4408: Enum.map_intersperse_list/3
(elixir 1.17.2) lib/enum.ex:1804: Enum.map_join/3
(ash 3.4.35) lib/mix/tasks/gen/ash.gen.resource.ex:290: anonymous fn/1 in Mix.Tasks.Ash.Gen.Resource.attributes/1
(elixir 1.17.2) lib/enum.ex:1804: anonymous fn/2 in Enum.map_join/3
(elixir 1.17.2) lib/enum.ex:4408: Enum.map_intersperse_list/3
(elixir 1.17.2) lib/enum.ex:1804: Enum.map_join/3
Expected behavior
Return an error response code but indicate the attribute modifier is unrecognizeable and perhaps point to the ones that are allowed.
Also, it will generate a resource with an incorrect type attribute (text in this case) which will compile error later and indicate the correct types. I think we should be able to check against that too.
Runtime
Elixir version 1.17.2
Erlang version Erlang/OTP 26 [erts-14.2.5]
OS Sonoma 14.5
Ash version 3.4.35
The text was updated successfully, but these errors were encountered:
Describe the bug
Currently the error messages for incorrect attribute details when using
ash.gen.resources
can be a little confusing to end users.To Reproduce
Run the
ash.gen.resource
generator with any attribute options that don't exist.It will output the following error message:
Expected behavior
Return an error response code but indicate the attribute modifier is unrecognizeable and perhaps point to the ones that are allowed.
Also, it will generate a resource with an incorrect type attribute (
text
in this case) which will compile error later and indicate the correct types. I think we should be able to check against that too.Runtime
The text was updated successfully, but these errors were encountered: