Return human error messages when calling export2sql with wrong path (#2480)
This commit is contained in:
parent
8f0e066135
commit
10e01b7bfc
|
@ -216,6 +216,10 @@ prepare_output(FileName, normal) when is_list(FileName) ->
|
||||||
case file:open(FileName, [write, raw]) of
|
case file:open(FileName, [write, raw]) of
|
||||||
{ok, Fd} ->
|
{ok, Fd} ->
|
||||||
Fd;
|
Fd;
|
||||||
|
{error, eacces} ->
|
||||||
|
exit({"Not enough permission to the file or path", FileName});
|
||||||
|
{error, enoent} ->
|
||||||
|
exit({"Path does not exist", FileName});
|
||||||
Err ->
|
Err ->
|
||||||
exit(Err)
|
exit(Err)
|
||||||
end;
|
end;
|
||||||
|
|
Loading…
Reference in New Issue