25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-24 16:23:40 +01:00

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

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;