Skip to content

Commit

Permalink
Clarify error message, closes #4499
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Aug 22, 2024
1 parent cba4947 commit 7e60edc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/ecto/query/planner.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2197,7 +2197,8 @@ defmodule Ecto.Query.Planner do
{{:source, {source, schema}, prefix || query.prefix, types}, fields}

{{:ok, {_, fields}}, _} ->
{{:map, Enum.map(fields, &{&1, {:value, :any}})}, Enum.map(fields, &select_field(&1, ix, :always))}
{{:map, Enum.map(fields, &{&1, {:value, :any}})},
Enum.map(fields, &select_field(&1, ix, :always))}

{:error, {:fragment, _, _}} ->
{{:value, :map}, [{:&, [], [ix]}]}
Expand Down Expand Up @@ -2299,8 +2300,8 @@ defmodule Ecto.Query.Planner do
_ ->
error!(
query,
"can only preload sources with a schema" <>
"(fragments, binaries and subqueries that do not select a schema are not supported)"
"can only preload sources with a schema " <>
"(fragments, binaries, and subqueries that do not select a from/join schema are not supported)"
)
end
end
Expand Down

0 comments on commit 7e60edc

Please sign in to comment.