summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/elixir/lib/exception.ex2
-rw-r--r--lib/elixir/test/elixir/exception_test.exs4
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/elixir/lib/exception.ex b/lib/elixir/lib/exception.ex
index e61067b13..49e0e2590 100644
--- a/lib/elixir/lib/exception.ex
+++ b/lib/elixir/lib/exception.ex
@@ -1665,7 +1665,7 @@ defmodule ErlangError do
def normalize({:badkey, key, term}, _stacktrace) do
message =
- "key #{inspect(key)} not found in: #{inspect(term)}. " <>
+ "key #{inspect(key)} not found in: #{inspect(term, pretty: true, limit: :infinity)}\n\n" <>
"If you are using the dot syntax, such as map.field, " <>
"make sure the left-hand side of the dot is a map"
diff --git a/lib/elixir/test/elixir/exception_test.exs b/lib/elixir/test/elixir/exception_test.exs
index 8ab46e3cf..030b68cce 100644
--- a/lib/elixir/test/elixir/exception_test.exs
+++ b/lib/elixir/test/elixir/exception_test.exs
@@ -643,12 +643,12 @@ defmodule ExceptionTest do
test "annotates undefined key error with nil hints" do
assert blame_message(nil, & &1.foo) ==
- "key :foo not found in: nil. If you are using the dot syntax, " <>
+ "key :foo not found in: nil\n\nIf you are using the dot syntax, " <>
"such as map.field, make sure the left-hand side of the dot is a map"
# we use `Code.eval_string/1` to escape the formatter and warnings
assert blame_message("nil.foo", &Code.eval_string/1) ==
- "key :foo not found in: nil. If you are using the dot syntax, " <>
+ "key :foo not found in: nil\n\nIf you are using the dot syntax, " <>
"such as map.field, make sure the left-hand side of the dot is a map"
end