fix: properly handle raised errors from async calculations

fix: ensure depended on attributes are selected in calculations
This commit is contained in:
Zach Daniel 2024-03-11 21:28:59 -04:00
parent 2c432bb193
commit ea9ec7dfef
2 changed files with 4 additions and 0 deletions

View file

@ -75,6 +75,9 @@ defmodule Ash.Actions.Read.AsyncLimiter do
{:ok, term} -> {:ok, term} ->
term term
{:ok, {:__exception__, e, stacktrace}} ->
reraise e, stacktrace
{:exit, term} -> {:exit, term} ->
{:error, term} {:error, term}

View file

@ -673,6 +673,7 @@ defmodule Ash.Actions.Read.Calculations do
query query
| load_through: load_through | load_through: load_through
} }
|> Ash.Query.ensure_selected(attr.name)
end end
agg = Ash.Resource.Info.aggregate(query.resource, load) -> agg = Ash.Resource.Info.aggregate(query.resource, load) ->