forked from MirrorHub/synapse
Correctly handle PusherConfigException
This commit is contained in:
parent
5d3e3c051d
commit
f2891d2487
1 changed files with 9 additions and 0 deletions
|
@ -19,6 +19,7 @@ import logging
|
||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
|
|
||||||
from synapse.metrics.background_process_metrics import run_as_background_process
|
from synapse.metrics.background_process_metrics import run_as_background_process
|
||||||
|
from synapse.push import PusherConfigException
|
||||||
from synapse.push.pusher import PusherFactory
|
from synapse.push.pusher import PusherFactory
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
@ -222,6 +223,14 @@ class PusherPool:
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
p = self.pusher_factory.create_pusher(pusherdict)
|
p = self.pusher_factory.create_pusher(pusherdict)
|
||||||
|
except PusherConfigException as e:
|
||||||
|
logger.warning(
|
||||||
|
"Pusher incorrectly configured user=%s, appid=%s, pushkey=%s: %s",
|
||||||
|
pusherdict.get('user_name'),
|
||||||
|
pusherdict.get('app_id'),
|
||||||
|
pusherdict.get('pushkey'),
|
||||||
|
e,
|
||||||
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
logger.exception("Couldn't start a pusher: caught Exception")
|
logger.exception("Couldn't start a pusher: caught Exception")
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue