Browse Source

[2676] Reorder and tweak exception to be closer to original

In case the auth wasn't there before the refactoring, it did a session
timeout, which resulted in DDNS_(START|STOP)_FORWARDER_ERROR log
message. So we handle the RPCRecipientMissing in the same branch (and
list above the RPCError, since it is a subclass of that).
Michal 'vorner' Vaner 12 years ago
parent
commit
3d8d88cb37
1 changed files with 6 additions and 4 deletions
  1. 6 4
      src/bin/ddns/ddns.py.in

+ 6 - 4
src/bin/ddns/ddns.py.in

@@ -544,10 +544,11 @@ class DDNSServer:
         '''Notify auth that DDNS Update messages can now be forwarded'''
         try:
             self._cc.rpc_call("start_ddns_forwarder", AUTH_MODULE_NAME)
+        except (SessionTimeout, SessionError, ProtocolError,
+            RPCRecipientMissing) as ex:
+            logger.error(DDNS_START_FORWARDER_FAIL, ex)
         except RPCError as e:
             logger.error(DDNS_START_FORWARDER_ERROR, e)
-        except (SessionTimeout, SessionError, ProtocolError) as ex:
-            logger.error(DDNS_START_FORWARDER_FAIL, ex)
 
     def __notify_stop_forwarder(self):
         '''Notify auth that DDNS Update messages should no longer be forwarded.
@@ -555,10 +556,11 @@ class DDNSServer:
         '''
         try:
             self._cc.rpc_call("stop_ddns_forwarder", AUTH_MODULE_NAME)
+        except (SessionTimeout, SessionError, ProtocolError,
+            RPCRecipientMissing) as ex:
+            logger.error(DDNS_STOP_FORWARDER_FAIL, ex)
         except RPCError as e:
             logger.error(DDNS_STOP_FORWARDER_ERROR, e)
-        except (SessionTimeout, SessionError, ProtocolError) as ex:
-            logger.error(DDNS_STOP_FORWARDER_FAIL, ex)
 
     def __notify_auth(self, zname, zclass):
         '''Notify auth of the update, if necessary.'''