Skip to content

Commit 55241d9

Browse files
michalmuskalaJosé Valim
authored andcommitted
Clarify behaviour of failing gaurds (#7334)
[ci skip]
1 parent 11086ac commit 55241d9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/elixir/pages/Guards.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ Other constructs are `for`, `with`, `try`/`rescue`/`catch`/`else`/, and the `mat
109109

110110
## Failing guards
111111

112-
Errors in guards do not result in runtime errors, but in guards failing. For example, the `length/1` function only works with lists. If we use it with anything else, a runtime error is raised:
112+
In guards, when functions would normally raise exceptions, they cause the guard to fail instead.
113+
For example, the `length/1` function only works with lists. If we use it with anything else, a runtime error is raised:
113114

114115
```elixir
115116
iex> length("hello")

0 commit comments

Comments
 (0)