Fix errors detected by Dialyzer

This commit is contained in:
Badlop 2010-10-15 13:11:14 +02:00
parent 7af47b9dbe
commit 2d08dcf11a
3 changed files with 11 additions and 8 deletions

View File

@ -162,7 +162,7 @@ write_event(Fd, {Time, {warning_msg, _GL, {Pid, Format, Args}}}) ->
file:write(Fd, io_lib:format(T ++ S, []));
_ ->
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;
write_event(_, _) ->
ok.

View File

@ -153,8 +153,8 @@ process_elements(Elements,State) ->
process_element(El=#xmlel{name=user, ns=_XMLNS},
State=#parsing_state{host=Host}) ->
case add_user(El,Host) of
{error, _Other} -> error;
_ -> ok
ok -> ok;
{error, _Other} -> error
end,
State;
@ -199,7 +199,7 @@ add_user(El, Domain) ->
add_user(El, Domain, ?BTL(User), ?BTL(Password)).
%% @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.
%% If user already exists, it will be only updated.
add_user(El, Domain, User, Password) ->
@ -221,7 +221,8 @@ add_user(El, Domain, User, Password) ->
end,
El);
{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.
%% @spec (User::string(), Password::string(), Domain::string())

View File

@ -2241,7 +2241,7 @@ get_node(global, Node, ["update"], Query, Lang) ->
[?XC("h1", ?T("Update ") ++ atom_to_list(Node))] ++
case Res of
ok -> [?XREST("Submitted")];
error -> [?XREST("Bad format")];
{error, ErrorText} -> [?XREST("Error: " ++ ErrorText)];
nothing -> []
end ++
[?XAE("form", [{"action", ""}, {"method", "post"}],
@ -2624,9 +2624,11 @@ node_update_parse_query(Node, Query) ->
{ok, _} ->
ok;
{error, Error} ->
?ERROR_MSG("~p~n", [Error]);
?ERROR_MSG("~p~n", [Error]),
{error, io_lib:format("~p", [Error])};
{badrpc, Error} ->
?ERROR_MSG("~p~n", [Error])
?ERROR_MSG("Bad RPC: ~p~n", [Error]),
{error, "Bad RPC: " ++ io_lib:format("~p", [Error])}
end;
_ ->
nothing