chore: add error context to hydrate references

This commit is contained in:
Zach Daniel 2023-11-20 06:38:43 -05:00
parent 944a4e128e
commit 48e8a414da

View file

@ -811,7 +811,7 @@ defmodule AshPostgres.Expr do
{:error, error} ->
raise """
Failed to hydrate references in #{inspect(calculation.module.expression(calculation.opts, calculation.context))}
Failed to hydrate references for resource #{inspect(resource)} in #{inspect(calculation.module.expression(calculation.opts, calculation.context))}
#{inspect(error)}
"""
@ -1039,7 +1039,7 @@ defmodule AshPostgres.Expr do
end
_ ->
raise "Failed to hydrate references in #{inspect(calculation.module.expression(calculation.opts, calculation.context))}"
raise "Failed to hydrate references for #{inspect(ref.resource)} in #{inspect(calculation.module.expression(calculation.opts, calculation.context))}"
end
end