Skip to content

Commit

Permalink
chore: add error context to hydrate references
Browse files Browse the repository at this point in the history
  • Loading branch information
zachdaniel committed Nov 20, 2023
1 parent 944a4e1 commit 48e8a41
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/expr.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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)}
"""
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 48e8a41

Please sign in to comment.