Skip to content

Commit c0d66ee

Browse files
committed
Fix #96: Remove old catch
1 parent ccd1c48 commit c0d66ee

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

rebar.config

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
%% == Dependencies and plugins ==
1212

1313
{project_plugins, [
14-
{rebar3_hank, "~> 1.4.0"},
15-
{rebar3_hex, "~> 7.0.7"},
16-
{erlfmt, "~> 1.6.2"},
17-
{rebar3_lint, "~> 3.1.0"},
18-
{rebar3_ex_doc, "~> 0.2.20"}
14+
{rebar3_hank, "~> 1.6.1"},
15+
{rebar3_hex, "~> 7.1.0"},
16+
{erlfmt, "~> 1.8.0"},
17+
{rebar3_lint, "~> 4.2.3"},
18+
{rebar3_ex_doc, "~> 0.2.31"}
1919
]}.
2020

2121
%% == Documentation ==

src/ktn_dodger.erl

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -380,22 +380,23 @@ extract_escript_header(_) ->
380380
no_header.
381381

382382
parse_form(Parser, Ts, L1, NoFail, Opt) ->
383-
case catch {ok, Parser(Ts, Opt)} of
384-
{'EXIT', Term} ->
385-
{error, io_error(L1, {unknown, Term}), L1};
386-
{error, Term} ->
383+
try Parser(Ts, Opt) of
384+
F ->
385+
{ok, F, L1}
386+
catch
387+
throw:{error, Term} ->
387388
IoErr = io_error(L1, Term),
388389
{error, IoErr, L1};
389-
{parse_error, _IoErr} when NoFail ->
390+
throw:{parse_error, _IoErr} when NoFail ->
390391
{ok,
391392
erl_syntax:set_pos(
392393
erl_syntax:text(tokens_to_string(Ts)),
393394
erl_anno:new(start_pos(Ts, L1))),
394395
L1};
395-
{parse_error, IoErr} ->
396+
throw:{parse_error, IoErr} ->
396397
{error, IoErr, L1};
397-
{ok, F} ->
398-
{ok, F, L1}
398+
_:Term ->
399+
{error, io_error(L1, {unknown, Term}), L1}
399400
end.
400401

401402
io_error(L, Desc) ->

0 commit comments

Comments
 (0)