mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-30 16:36:29 +01:00
Fix errors detected by Dialyzer
This commit is contained in:
parent
864b0ec149
commit
d6a69dbca5
@ -162,7 +162,7 @@ write_event(Fd, {Time, {warning_msg, _GL, {Pid, Format, Args}}}) ->
|
|||||||
file:write(Fd, io_lib:format(T ++ S, []));
|
file:write(Fd, io_lib:format(T ++ S, []));
|
||||||
_ ->
|
_ ->
|
||||||
F = add_node("ERROR: ~p - ~p~n", Pid),
|
F = add_node("ERROR: ~p - ~p~n", Pid),
|
||||||
file:write(Fd, io:format(T ++ F, [Format,Args]))
|
file:write(Fd, io_lib:format(T ++ F, [Format,Args]))
|
||||||
end;
|
end;
|
||||||
write_event(_, _) ->
|
write_event(_, _) ->
|
||||||
ok.
|
ok.
|
||||||
|
@ -117,8 +117,8 @@ process_elements(Elements,State) ->
|
|||||||
process_element(El=#xmlel{name=user, ns=_XMLNS},
|
process_element(El=#xmlel{name=user, ns=_XMLNS},
|
||||||
State=#parsing_state{host=Host}) ->
|
State=#parsing_state{host=Host}) ->
|
||||||
case add_user(El,Host) of
|
case add_user(El,Host) of
|
||||||
{error, _Other} -> error;
|
ok -> ok;
|
||||||
_ -> ok
|
{error, _Other} -> error
|
||||||
end,
|
end,
|
||||||
State;
|
State;
|
||||||
|
|
||||||
@ -163,7 +163,7 @@ add_user(El, Domain) ->
|
|||||||
add_user(El, Domain, User, Password).
|
add_user(El, Domain, User, Password).
|
||||||
|
|
||||||
%% @spec (El::xmlel(), Domain::string(), User::string(), Password::string())
|
%% @spec (El::xmlel(), Domain::string(), User::string(), Password::string())
|
||||||
%% -> ok | {atomic, exists} | {error, not_allowed}
|
%% -> ok | {error, ErrorText::string()}
|
||||||
%% @doc Add a new user to the database.
|
%% @doc Add a new user to the database.
|
||||||
%% If user already exists, it will be only updated.
|
%% If user already exists, it will be only updated.
|
||||||
add_user(El, Domain, User, Password) ->
|
add_user(El, Domain, User, Password) ->
|
||||||
@ -185,7 +185,8 @@ add_user(El, Domain, User, Password) ->
|
|||||||
end,
|
end,
|
||||||
El);
|
El);
|
||||||
{error, Other} ->
|
{error, Other} ->
|
||||||
?ERROR_MSG("Error adding user ~s@~s: ~p~n", [User, Domain, Other])
|
?ERROR_MSG("Error adding user ~s@~s: ~p~n", [User, Domain, Other]),
|
||||||
|
{error, Other}
|
||||||
end.
|
end.
|
||||||
|
|
||||||
%% @spec (User::string(), Password::string(), Domain::string())
|
%% @spec (User::string(), Password::string(), Domain::string())
|
||||||
|
@ -859,7 +859,7 @@ terminate(Reason, StateName, StateData) ->
|
|||||||
false ->
|
false ->
|
||||||
ok;
|
ok;
|
||||||
Key ->
|
Key ->
|
||||||
ejabberd_s2s:remove_connectio
|
ejabberd_s2s:remove_connection
|
||||||
({StateData#state.myname, StateData#state.server}, self(), Key)
|
({StateData#state.myname, StateData#state.server}, self(), Key)
|
||||||
end,
|
end,
|
||||||
%% bounce queue manage by process and Erlang message queue
|
%% bounce queue manage by process and Erlang message queue
|
||||||
|
@ -2539,7 +2539,7 @@ get_node(global, Node, ["update"], Query, Lang) ->
|
|||||||
[?XC('h1', ?T("Update ") ++ atom_to_list(Node))] ++
|
[?XC('h1', ?T("Update ") ++ atom_to_list(Node))] ++
|
||||||
case Res of
|
case Res of
|
||||||
ok -> [?XREST("Submitted")];
|
ok -> [?XREST("Submitted")];
|
||||||
error -> [?XREST("Bad format")];
|
{error, ErrorText} -> [?XREST("Error: " ++ ErrorText)];
|
||||||
nothing -> []
|
nothing -> []
|
||||||
end ++
|
end ++
|
||||||
[?XAE('form', [?XMLATTR('action', <<>>), ?XMLATTR('method', <<"post">>)],
|
[?XAE('form', [?XMLATTR('action', <<>>), ?XMLATTR('method', <<"post">>)],
|
||||||
@ -2922,9 +2922,11 @@ node_update_parse_query(Node, Query) ->
|
|||||||
{ok, _} ->
|
{ok, _} ->
|
||||||
ok;
|
ok;
|
||||||
{error, Error} ->
|
{error, Error} ->
|
||||||
?ERROR_MSG("~p~n", [Error]);
|
?ERROR_MSG("~p~n", [Error]),
|
||||||
|
{error, io_lib:format("~p", [Error])};
|
||||||
{badrpc, Error} ->
|
{badrpc, Error} ->
|
||||||
?ERROR_MSG("~p~n", [Error])
|
?ERROR_MSG("Bad RPC: ~p~n", [Error]),
|
||||||
|
{error, "Bad RPC: " ++ io_lib:format("~p", [Error])}
|
||||||
end;
|
end;
|
||||||
_ ->
|
_ ->
|
||||||
nothing
|
nothing
|
||||||
|
Loading…
Reference in New Issue
Block a user