-
-
Notifications
You must be signed in to change notification settings - Fork 357
Open
Open
Copy link
Labels
enhancementNew feature or requestNew feature or request
Milestone
Description
Code of Conduct
- I agree to follow this project's Code of Conduct
AI Policy
- I agree to follow this project's AI Policy, or I agree that AI was not used while creating this issue.
Is your feature request related to a problem? Please describe.
When writing a custom validation, if I return
{:error, field: :my_argument, message: "message"}from the validate callback, it generates an Ash.Error.Changes.InvalidAttribute error, even if the specified field is an argument.
Describe the solution you'd like
It seems to me like it would make sense to automatically detect whether it's an attribute or argument and return the associated exception type.
Describe alternatives you've considered
This isn't a huge deal because I can call Ash.Error.Changes.InvalidArgument.exception directly and return that from the validate callback, but it's a bit more verbose IMO
Additional context
No response
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Type
Projects
Status
Someday