Skip to content

Commit

Permalink
nicer error message
Browse files Browse the repository at this point in the history
  • Loading branch information
greg-rychlewski committed Nov 2, 2024
1 parent a54d96f commit 04b4393
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 04b4393

Please sign in to comment.