-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* fix no_nested_try_catch * Update test/examples/pass_no_nested_try_catch.erl Co-authored-by: Brujo Benavides <[email protected]> --------- Co-authored-by: Brujo Benavides <[email protected]>
- Loading branch information
1 parent
df9fe91
commit 919fa6f
Showing
3 changed files
with
33 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
-module(pass_no_nested_try_catch). | ||
|
||
-export([example/0]). | ||
|
||
%% @doc If this fails in do:something/0, we handle the error. | ||
%% But if it fails in do:something_else/2, we ignore it. | ||
example() -> | ||
try do:something() of | ||
{ok, KeepGoing} -> | ||
try | ||
do:something_else("and", KeepGoing) | ||
catch | ||
_:_ -> {ignore, errors, here} | ||
end | ||
catch | ||
Kind:Error -> | ||
try this:block(is, also, not_nested) catch _:_ -> {Kind, Error} end | ||
after | ||
try this:one(is, "not", nested, either) catch _:_ -> ok end | ||
end. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters