@@ -807,7 +807,7 @@ defmodule Access do
807807 iex> get_in([:a, :b, :c], [Access.at!(2)])
808808 :c
809809 iex> get_in([:a, :b, :c], [Access.at!(3)])
810- ** (Enum.OutOfBoundsError) out of bounds error
810+ ** (Enum.OutOfBoundsError) out of bounds error at position 3 when traversing enumerable [:a, :b, :c]
811811
812812 """
813813 @ doc since: "1.11.0"
@@ -819,12 +819,14 @@ defmodule Access do
819819 defp at! ( :get , data , index , next ) when is_list ( data ) do
820820 case Enum . fetch ( data , index ) do
821821 { :ok , value } -> next . ( value )
822- :error -> raise Enum.OutOfBoundsError
822+ :error -> raise Enum.OutOfBoundsError , index: index , enumerable: data
823823 end
824824 end
825825
826826 defp at! ( :get_and_update , data , index , next ) when is_list ( data ) do
827- get_and_update_at ( data , index , next , [ ] , fn -> raise Enum.OutOfBoundsError end )
827+ get_and_update_at ( data , index , next , [ ] , fn ->
828+ raise Enum.OutOfBoundsError , index: index , enumerable: data
829+ end )
828830 end
829831
830832 defp at! ( _op , data , _index , _next ) do
0 commit comments