]> granicus.if.org Git - ejabberd/commitdiff
added error handling in mod_pubsub_odbc.
authorHAMANO Tsukasa <hamano@cuspy.org>
Wed, 23 Apr 2014 14:35:34 +0000 (23:35 +0900)
committerHAMANO Tsukasa <hamano@cuspy.org>
Wed, 23 Apr 2014 14:35:34 +0000 (23:35 +0900)
src/mod_pubsub_odbc.erl

index 3d26ad0fa5989a56d6bae3c59c4df61238106ca3..00e619213306eff2387cf321c40f658f0305c7df 100644 (file)
@@ -885,10 +885,10 @@ unsubscribe_user(Entity, Owner) ->
     Host = host(element(2, BJID)),
     spawn(fun () ->
                  lists:foreach(fun (PType) ->
-                                       {result, Subscriptions} =
-                                           node_action(Host, PType,
+                                       case node_action(Host, PType,
                                                        get_entity_subscriptions,
-                                                       [Host, Entity]),
+                                                       [Host, Entity]) of
+                                               {result, Subscriptions} ->
                                        lists:foreach(fun ({#pubsub_node{options
                                                                             =
                                                                             Options,
@@ -922,7 +922,10 @@ unsubscribe_user(Entity, Owner) ->
                                                              end;
                                                          (_) -> ok
                                                      end,
-                                                     Subscriptions)
+                                                     Subscriptions);
+                                       Error ->
+                                           ?DEBUG("Error at node_action: ~p", [Error])
+                                       end
                                end,
                                plugins(Host))
          end).