mirror of
https://github.com/processone/ejabberd
synced 2025-10-03 09:49:18 +02:00
Report db failures in mod_muc_mnesia:restore_room
This commit is contained in:
parent
6214e0385d
commit
1a9b147baf
2 changed files with 4 additions and 2 deletions
|
@ -76,9 +76,11 @@ store_room(_LServer, Host, Name, Opts, _) ->
|
||||||
mnesia:transaction(F).
|
mnesia:transaction(F).
|
||||||
|
|
||||||
restore_room(_LServer, Host, Name) ->
|
restore_room(_LServer, Host, Name) ->
|
||||||
case catch mnesia:dirty_read(muc_room, {Name, Host}) of
|
try mnesia:dirty_read(muc_room, {Name, Host}) of
|
||||||
[#muc_room{opts = Opts}] -> Opts;
|
[#muc_room{opts = Opts}] -> Opts;
|
||||||
_ -> error
|
_ -> error
|
||||||
|
catch
|
||||||
|
_:_ -> {error, db_failure}
|
||||||
end.
|
end.
|
||||||
|
|
||||||
forget_room(_LServer, Host, Name) ->
|
forget_room(_LServer, Host, Name) ->
|
||||||
|
|
|
@ -220,7 +220,7 @@ restore_room(LServer, Host, Name) ->
|
||||||
Opts2 = lists:keystore(subscribers, 1, OptsD, {subscribers, SubData}),
|
Opts2 = lists:keystore(subscribers, 1, OptsD, {subscribers, SubData}),
|
||||||
mod_muc:opts_to_binary(Opts2);
|
mod_muc:opts_to_binary(Opts2);
|
||||||
_ ->
|
_ ->
|
||||||
{error, db_failure}
|
{error, db_failure}
|
||||||
end;
|
end;
|
||||||
{selected, _} ->
|
{selected, _} ->
|
||||||
error;
|
error;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue