diff options
author | Eric Meadows-Jönsson <[email protected]> | 2017-10-25 21:11:28 +0200 |
---|---|---|
committer | Eric Meadows-Jönsson <[email protected]> | 2017-10-25 21:11:28 +0200 |
commit | e46c14eab593f9c4cc4cf0efe6f3753964035b22 (patch) | |
tree | 242423f2433269a8c231016fe76ce7afe9e7b31d /lib/stdlib | |
parent | 976bd95467a9dcae615a087c431024aabaebe8d6 (diff) | |
download | otp-e46c14eab593f9c4cc4cf0efe6f3753964035b22.tar.gz otp-e46c14eab593f9c4cc4cf0efe6f3753964035b22.tar.bz2 otp-e46c14eab593f9c4cc4cf0efe6f3753964035b22.zip |
Return error when unable to make dir
Diffstat (limited to 'lib/stdlib')
-rw-r--r-- | lib/stdlib/src/erl_tar.erl | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/stdlib/src/erl_tar.erl b/lib/stdlib/src/erl_tar.erl index 76f0b38108..48bbd38f9b 100644 --- a/lib/stdlib/src/erl_tar.erl +++ b/lib/stdlib/src/erl_tar.erl @@ -1650,8 +1650,12 @@ write_file(Name, Bin) -> case file:write_file(Name, Bin) of ok -> ok; {error,enoent} -> - ok = make_dirs(Name, file), - write_file(Name, Bin); + case make_dirs(Name, file) of + ok -> + write_file(Name, Bin); + {error,Reason} -> + throw({error, Reason}) + end; {error,Reason} -> throw({error, Reason}) end. |