diff options
Diffstat (limited to 'erts/preloaded/src/prim_file.erl')
-rw-r--r-- | erts/preloaded/src/prim_file.erl | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/erts/preloaded/src/prim_file.erl b/erts/preloaded/src/prim_file.erl index bf8879c2a0..489e8ca4ea 100644 --- a/erts/preloaded/src/prim_file.erl +++ b/erts/preloaded/src/prim_file.erl @@ -933,7 +933,12 @@ list_dir_int(Port, Dir) -> fun(P) -> case list_dir_response(P, []) of {ok, RawNames} -> - {ok, list_dir_convert(RawNames)}; + try + {ok, list_dir_convert(RawNames)} + catch + throw:Reason -> + Reason + end; Error -> Error end @@ -979,7 +984,7 @@ list_dir_convert([Name|Names]) -> {error, ignore} -> list_dir_convert(Names); {error, error} -> - {error, {no_translation, Name}}; + throw({error, {no_translation, Name}}); Converted when is_list(Converted) -> [Converted|list_dir_convert(Names)] end; @@ -990,9 +995,9 @@ list_dir_convert_all([Name|Names]) -> %% a binary. case prim_file:internal_native2name(Name) of {error, _} -> - [Name|list_dir_convert(Names)]; + [Name|list_dir_convert_all(Names)]; Converted when is_list(Converted) -> - [Converted|list_dir_convert(Names)] + [Converted|list_dir_convert_all(Names)] end; list_dir_convert_all([]) -> []. |