Skip to content

Inconsistent option error? vs not_found_error? for Ash.get() vs get? true in action? #2569

Description

@StephanH90

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.

Versions

Ash: 3.15

Operating system

ubuntu

Current Behavior

I'm not sure it's a bug or by design but I noticed that the options for "don't return an error if no record is found" is different between Ash.get vs a read action with get? true:

# Using Ash.get():
Ash.get(SomeResource, error?: false) # <-- here its `error?`

# Using a read action in a resource:
defmodule MyResource do
  actions do
    read :some_action do
      get? true
    end
  end
end

MyResource.some_action(not_found_error?: false) # <-- here its `not_found_error?`

They seem to be doing the same thing, so shouldn't they use the same option?

Reproduction

No response

Expected Behavior

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions