25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-24 17:29:28 +01:00

Merge 1883 from trunk.

* src/ejabberd_listener.erl: More error detections

SVN Revision: 1951
This commit is contained in:
Badlop 2009-03-03 19:39:36 +00:00
parent f80758f0de
commit 36fc43c364
2 changed files with 9 additions and 0 deletions

View File

@ -1,5 +1,7 @@
2009-03-03 Badlop <badlop@process-one.net>
* src/ejabberd_listener.erl: More error detections
* src/ejabberd_config.erl: Check certfiles are readable on server
start and listener start (EJAB-753)
* src/ejabberd_listener.erl: Likewise

View File

@ -124,6 +124,7 @@ init(PortIP, Module, Opts1) ->
{error, Reason} ->
ReasonT = case Reason of
eaddrnotavail -> "IP address not available: " ++ IPS;
eaddrinuse -> "IP address and port number already used: "++IPS++" "++integer_to_list(Port);
_ -> atom_to_list(Reason)
end,
?ERROR_MSG("Failed to open socket:~n ~p~nReason: ~s",
@ -225,6 +226,12 @@ start_listener(Port, Module, Opts) ->
"It could not be loaded or is not an ejabberd listener.~n"
"Error: ~p~n", [Module, Error]),
{error, lists:flatten(EStr)};
{error, {already_started, _Pid} = Error} ->
EStr = io_lib:format(
"Error starting the ejabberd listener: ~p.~n"
"A listener is already started in that port number and IP address:~n~p~n"
"Error: ~p~n", [Module, Port, Error]),
{error, lists:flatten(EStr)};
{error, Error} ->
{error, Error}
end.