Skip to content

Commit 46a1988

Browse files
committed
Rewrite the last legacy catch in inet_db
1 parent 6189ca0 commit 46a1988

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

lib/kernel/src/inet_db.erl

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -285,13 +285,12 @@ add_rc(File) ->
285285
Error -> Error
286286
end.
287287

288-
%% Add an inetrc binary term must be a rc list
288+
%% Add an inetrc binary term that must be an rc list
289289
add_rc_bin(Bin) ->
290-
case catch binary_to_term(Bin) of
291-
List when is_list(List) ->
292-
add_rc_list(List);
293-
_ ->
294-
{error, badarg}
290+
try binary_to_term(Bin) of
291+
List when is_list(List) -> add_rc_list(List);
292+
_ -> {error, badarg}
293+
catch error : _ -> {error, badarg}
295294
end.
296295

297296
add_rc_list(List) -> call({add_rc_list, List}).

0 commit comments

Comments
 (0)