diff --git a/platypush/plugins/pushbullet/listener.py b/platypush/plugins/pushbullet/listener.py index 796d0d6c..609d1d5a 100644 --- a/platypush/plugins/pushbullet/listener.py +++ b/platypush/plugins/pushbullet/listener.py @@ -17,6 +17,7 @@ class Listener(_Listener): on_close: Optional[Callable[[], None]] = None, **kwargs, ): + kwargs['on_error'] = self._err_callback() super().__init__(*args, **kwargs) self._on_open_hndl = on_open self._on_close_hndl = on_close @@ -42,5 +43,11 @@ class Listener(_Listener): return callback + def _err_callback(self): + def callback(e): + self.logger.error('Pushbullet listener error: %s: %s', type(e).__name__, e) + + return callback + # vim:sw=4:ts=4:et: