1
0
Fork 0
mirror of https://github.com/processone/ejabberd synced 2025-10-06 03:50:15 +02:00

Improve logging of Redis errors

This commit is contained in:
Evgeniy Khramtsov 2017-04-07 09:10:33 +03:00
parent 245fe04289
commit 3729acc5b0
6 changed files with 93 additions and 116 deletions

View file

@ -73,8 +73,7 @@ init() ->
ejabberd_redis:del([NodeKey])
end),
ok;
Err ->
?ERROR_MSG("redis request failed: ~p", [Err]),
{error, _} ->
{error, db_failure}
end.
@ -101,8 +100,7 @@ register_stream(SID, Pid) ->
[SIDKey, Val]),
{error, db_failure}
end
catch _:{badmatch, Err} ->
?ERROR_MSG("redis request failed: ~p", [Err]),
catch _:{badmatch, {error, _}} ->
{error, db_failure}
end.
@ -135,8 +133,7 @@ unregister_stream(SID) ->
[SIDKey, Val]),
{error, db_failure}
end
catch _:{badmatch, Err} ->
?ERROR_MSG("redis request failed: ~p", [Err]),
catch _:{badmatch, {error, _}} ->
{error, db_failure}
end.
@ -171,8 +168,7 @@ activate_stream(SID, IJID, MaxConnections, _Node) ->
[SIDKey, Val]),
{error, db_failure}
end
catch _:{badmatch, Err} ->
?ERROR_MSG("redis request failed: ~p", [Err]),
catch _:{badmatch, {error, _}} ->
{error, db_failure}
end.