Skip to content

Commit 7ad1450

Browse files
authored
Document Map.fetch!/2 exception in its doc (#14573)
1 parent fb9a9e9 commit 7ad1450

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/elixir/lib/map.ex

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,11 @@ defmodule Map do
317317
iex> Map.fetch!(%{a: 1}, :a)
318318
1
319319
320+
When the key is missing, an exception is raised:
321+
322+
Map.fetch!(%{a: 1}, :b)
323+
** (KeyError) key :b not found in: %{a: 1}
324+
320325
"""
321326
@spec fetch!(map, key) :: value
322327
def fetch!(map, key) do

0 commit comments

Comments
 (0)