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

Raise bad_node instead of node_down for consistency reason

This commit is contained in:
Evgeniy Khramtsov 2017-03-30 17:51:37 +03:00
parent f5f353d90a
commit 3e4ed83cb3
5 changed files with 9 additions and 9 deletions

View File

@ -209,7 +209,7 @@ decode_pid(PidBin, NodeBin) ->
Node ->
try set_node_id(PidStr, NodeBin)
catch _:badarg ->
erlang:error({node_down, Node})
erlang:error({bad_node, Node})
end
end.

View File

@ -158,7 +158,7 @@ row_to_route(Domain, {ServerHost, NodeS, PidS, LocalHintS} = Row) ->
server_host = ServerHost,
pid = aux:decode_pid(PidS, NodeS),
local_hint = dec_local_hint(LocalHintS)}]
catch _:{node_down, _} ->
catch _:{bad_node, _} ->
[];
E:R ->
?ERROR_MSG("failed to decode row from 'route' table:~n"

View File

@ -98,7 +98,7 @@ delete_session(_LUser, LServer, _LResource, {Now, Pid}) ->
?SQL("delete from sm"
" where usec=%(TS)d and pid=%(PidS)s")),
try {ok, row_to_session(LServer, Row)}
catch _:{node_down, _} -> {error, notfound}
catch _:{bad_node, _} -> {error, notfound}
end;
{selected, []} ->
{error, notfound};
@ -122,7 +122,7 @@ get_sessions(LServer) ->
lists:flatmap(
fun(Row) ->
try [row_to_session(LServer, Row)]
catch _:{node_down, _} -> []
catch _:{bad_node, _} -> []
end
end, Rows);
Err ->
@ -140,7 +140,7 @@ get_sessions(LUser, LServer) ->
lists:flatmap(
fun(Row) ->
try [row_to_session(LServer, Row)]
catch _:{node_down, _} -> []
catch _:{bad_node, _} -> []
end
end, Rows);
Err ->
@ -158,7 +158,7 @@ get_sessions(LUser, LServer, LResource) ->
lists:flatmap(
fun(Row) ->
try [row_to_session(LServer, Row)]
catch _:{node_down, _} -> []
catch _:{bad_node, _} -> []
end
end, Rows);
Err ->

View File

@ -58,7 +58,7 @@ find_session(SID) ->
?SQL("select @(pid)s, @(node)s from bosh where sid=%(SID)s")) of
{selected, [{Pid, Node}]} ->
try {ok, aux:decode_pid(Pid, Node)}
catch _:{node_down, _} -> error
catch _:{bad_node, _} -> error
end;
{selected, []} ->
error;

View File

@ -202,7 +202,7 @@ find_online_room(ServerHost, Room, Host) ->
"name=%(Room)s and host=%(Host)s")) of
{selected, [{PidS, NodeS}]} ->
try {ok, aux:decode_pid(PidS, NodeS)}
catch _:{node_down, _} -> error
catch _:{bad_node, _} -> error
end;
{selected, []} ->
error;
@ -232,7 +232,7 @@ get_online_rooms(ServerHost, Host, _RSM) ->
lists:flatmap(
fun({Room, PidS, NodeS}) ->
try [{Room, Host, aux:decode_pid(PidS, NodeS)}]
catch _:{node_down, _} -> []
catch _:{bad_node, _} -> []
end
end, Rows);
Err ->