mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-08-09 16:26:53 +02:00
elixir: add eval results to try-rescue examples
This commit is contained in:
@@ -343,6 +343,7 @@ rescue
|
|||||||
RuntimeError -> "rescued a runtime error"
|
RuntimeError -> "rescued a runtime error"
|
||||||
_error -> "this will rescue any error"
|
_error -> "this will rescue any error"
|
||||||
end
|
end
|
||||||
|
#=> "rescued a runtime error"
|
||||||
|
|
||||||
# All exceptions have a message
|
# All exceptions have a message
|
||||||
try do
|
try do
|
||||||
@@ -351,6 +352,7 @@ rescue
|
|||||||
x in [RuntimeError] ->
|
x in [RuntimeError] ->
|
||||||
x.message
|
x.message
|
||||||
end
|
end
|
||||||
|
#=> "some error"
|
||||||
|
|
||||||
## ---------------------------
|
## ---------------------------
|
||||||
## -- Concurrency
|
## -- Concurrency
|
||||||
|
Reference in New Issue
Block a user