-
-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
250f51f
commit b16cbf7
Showing
8 changed files
with
223 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
defmodule Ash.Error.Query.NoReadAction do | ||
@moduledoc "Used when a resource would be read but has no read action" | ||
use Ash.Error | ||
|
||
def_ash_error([:resource, :when], class: :invalid) | ||
|
||
defimpl Ash.ErrorKind do | ||
def id(_), do: Ecto.UUID.generate() | ||
|
||
def code(_), do: "no_read_action" | ||
|
||
def message(error) do | ||
if error.when do | ||
"No read action exists for #{inspect(error.resource)} when: #{error.when}" | ||
else | ||
"No read action exists for #{inspect(error.resource)}" | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
defmodule Ash.Error.Query.NoSuchRelationship do | ||
@moduledoc "Used when an relationship that doesn't exist is used in a query" | ||
use Ash.Error | ||
|
||
def_ash_error([:resource, :name], class: :invalid) | ||
|
||
defimpl Ash.ErrorKind do | ||
def id(_), do: Ecto.UUID.generate() | ||
|
||
def code(_), do: "no_such_relationship" | ||
|
||
def message(error) do | ||
"No such relationship #{error.name} for resource #{inspect(error.resource)}" | ||
end | ||
end | ||
end |
Oops, something went wrong.