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
When building a read query for an action with only optional arguments, a misleading error message occurs when no arguments are passed.
iex(1)> Ash.Query.for_read(Hsm.FFL.ADRecord, :bound_book_report, actor: nil)
** (Ash.Error.Forbidden) Forbidden Error
* The domain Hsm.FFL requires that an actor is provided at all times and none was provided.
(elixir 1.17.3) lib/process.ex:864: Process.info/2
(ash 3.4.35)
To Reproduce
Build a read query on any action that has only optional arguments. Not sure if the same error also happens when the action has mandatory arguments.
Expected behavior
The error should indicate that it is an action that accepts arguments, but no arguments were passed. That or maybe it should automatically insert an empty map as the arguments? 🤔
The text was updated successfully, but these errors were encountered:
Could it be that your domain force authorization, @frankdugan3? Because in that case the error looks exactly like you described (and it makes sense to me):
If a keyword list is passed then it should be treated as an opts list, so it should see actor: nil. the check to require an actor allows nil as a value, it just requires specifying it in some way.
Describe the bug
When building a read query for an action with only optional arguments, a misleading error message occurs when no arguments are passed.
To Reproduce
Build a read query on any action that has only optional arguments. Not sure if the same error also happens when the action has mandatory arguments.
Expected behavior
The error should indicate that it is an action that accepts arguments, but no arguments were passed. That or maybe it should automatically insert an empty map as the arguments? 🤔
The text was updated successfully, but these errors were encountered: