1
0
mirror of https://github.com/adambard/learnxinyminutes-docs.git synced 2025-08-13 18:24:39 +02:00

Merge pull request #2008 from chris-martin/elixir-try

elixir: add eval results to try-rescue examples
This commit is contained in:
ven
2015-11-08 21:38:30 +01:00

View File

@@ -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