Skip to content

Commit

Permalink
docs: improve error handling docs
Browse files Browse the repository at this point in the history
  • Loading branch information
zachdaniel committed Dec 7, 2024
1 parent 0ad0d3b commit 760783d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion documentation/topics/development/error-handling.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ For example:
```elixir
def change(changeset, _, _) do
if some_condition(changeset) do
error = Ash.Error.Changes.Required.new(
error = Ash.Error.Changes.Required.exception(
field: :foo,
type: :attribute,
resource: changeset.resource
Expand Down Expand Up @@ -127,3 +127,8 @@ defmodule Ash.Error.Action.InvalidArgument do
end
end
```

## API Extensions

AshJsonApi and AshGraphql both use a special protocol to determine how (and if) a raised or returned error should be displayed.
See [AshJsonApi.Error](https://hexdocs.pm/ash_json_api/AshJsonApi.Error.html) and [AshGraphl.Error](https://hexdocs.pm/ash_graphql/AshGraphql.Error.html)

0 comments on commit 760783d

Please sign in to comment.