Return human error messages when calling export2sql with wrong path (#2480)

This commit is contained in:
Badlop 2018-08-13 13:56:29 +02:00
parent 8f0e066135
commit 10e01b7bfc
1 changed files with 4 additions and 0 deletions

View File

@ -216,6 +216,10 @@ prepare_output(FileName, normal) when is_list(FileName) ->
case file:open(FileName, [write, raw]) of
{ok, Fd} ->
Fd;
{error, eacces} ->
exit({"Not enough permission to the file or path", FileName});
{error, enoent} ->
exit({"Path does not exist", FileName});
Err ->
exit(Err)
end;