mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-27 17:26:39 +03:00
elixir: add eval results to try-rescue examples
This commit is contained in:
parent
8799f11b89
commit
33628dca5c
@ -343,6 +343,7 @@ rescue
|
||||
RuntimeError -> "rescued a runtime error"
|
||||
_error -> "this will rescue any error"
|
||||
end
|
||||
#=> "rescued a runtime error"
|
||||
|
||||
# All exceptions have a message
|
||||
try do
|
||||
@ -351,6 +352,7 @@ rescue
|
||||
x in [RuntimeError] ->
|
||||
x.message
|
||||
end
|
||||
#=> "some error"
|
||||
|
||||
## ---------------------------
|
||||
## -- Concurrency
|
||||
|
Loading…
Reference in New Issue
Block a user