Skip to content

Commit

Permalink
Improve error message for interpolated field/2 names (#4540)
Browse files Browse the repository at this point in the history
  • Loading branch information
greg-rychlewski authored Nov 2, 2024
1 parent 90928ea commit 98ba6fe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ecto/query/builder.ex
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ defmodule Ecto.Query.Builder do

defp escape_field!(expr, field, _vars) do
error!("""
cannot fetch field `#{field}` from `#{Macro.to_string(expr)}`. Can only fetch fields from:
cannot fetch field `#{Macro.to_string(field)}` from `#{Macro.to_string(expr)}`. Can only fetch fields from:
* sources, such as `p` in `from p in Post`
* named bindings, such as `as(:post)` in `from Post, as: :post`
Expand Down

0 comments on commit 98ba6fe

Please sign in to comment.