From 48e8a414da86c1f8d3847180bc7771c849d58fb8 Mon Sep 17 00:00:00 2001 From: Zach Daniel Date: Mon, 20 Nov 2023 06:38:43 -0500 Subject: [PATCH] chore: add error context to hydrate references --- lib/expr.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/expr.ex b/lib/expr.ex index f3fd5204..7559bffd 100644 --- a/lib/expr.ex +++ b/lib/expr.ex @@ -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