25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-22 16:20:52 +01:00

* src/ejabberd_listener.erl: More error detections

SVN Revision: 1883
This commit is contained in:
Badlop 2009-02-17 09:53:29 +00:00
parent 4659ae7683
commit e4a3cdb486
2 changed files with 11 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2009-02-17 Badlop <badlop@process-one.net>
* src/ejabberd_listener.erl: More error detections
2009-02-16 Badlop <badlop@process-one.net>
* src/ejabberd_config.erl: Check certfiles are readable on server

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.