We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
inet_db
1 parent 6189ca0 commit 46a1988Copy full SHA for 46a1988
1 file changed
lib/kernel/src/inet_db.erl
@@ -285,13 +285,12 @@ add_rc(File) ->
285
Error -> Error
286
end.
287
288
-%% Add an inetrc binary term must be a rc list
+%% Add an inetrc binary term that must be an rc list
289
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}
+ try binary_to_term(Bin) of
+ List when is_list(List) -> add_rc_list(List);
+ _ -> {error, badarg}
+ catch error : _ -> {error, badarg}
295
296
297
add_rc_list(List) -> call({add_rc_list, List}).
0 commit comments