Skip to content

Commit

Permalink
docs(trans): improve missing attr exception message
Browse files Browse the repository at this point in the history
  • Loading branch information
BartOtten committed Nov 8, 2024
1 parent fe4c56d commit 53996f8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/routex/extension/translations.ex
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ defmodule Routex.Extension.Translations do

raise(
"Routex backend `#{backend}` lists extension `#{__MODULE__}` but
neither :language nor :locale was found in private.routex of route #{inspect(route, pretty: true)}."
neither the attribute :language nor :locale was found in private.routex
of route #{inspect(route, pretty: true)}."
)
end

Expand Down
2 changes: 1 addition & 1 deletion test/routex/extension/translations_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ defmodule Routex.Extension.TranslationsTest do
exception =
assert_raise RuntimeError, fn -> Translations.transform(routes, RtxBackend, nil) end

assert exception.message =~ "neither :language nor :locale was found"
assert exception.message =~ "neither the attribute :language nor :locale was found"
end

test "should raise when no :language and invalid :locale attribute is set in a route" do
Expand Down

0 comments on commit 53996f8

Please sign in to comment.