Merge branch 'v1'
This commit is contained in:
@@ -90,7 +90,7 @@ class InvalidParameters(ExternalError):
|
|||||||
class NotLoggedIn(ExternalError):
|
class NotLoggedIn(ExternalError):
|
||||||
"""Raised by Facebook if the client has been logged out."""
|
"""Raised by Facebook if the client has been logged out."""
|
||||||
|
|
||||||
code = attr.ib(1357001)
|
code = attr.ib()
|
||||||
|
|
||||||
|
|
||||||
@attr.s(slots=True, auto_exc=True)
|
@attr.s(slots=True, auto_exc=True)
|
||||||
|
@@ -168,10 +168,10 @@ class Listener:
|
|||||||
(j,) = session._graphql_requests(
|
(j,) = session._graphql_requests(
|
||||||
_graphql.from_doc_id("1349387578499440", params)
|
_graphql.from_doc_id("1349387578499440", params)
|
||||||
)
|
)
|
||||||
try:
|
sequence_id = j["viewer"]["message_threads"]["sync_sequence_id"]
|
||||||
return int(j["viewer"]["message_threads"]["sync_sequence_id"])
|
if not sequence_id:
|
||||||
except (KeyError, ValueError) as e:
|
raise _exception.NotLoggedIn("Failed fetching sequence id")
|
||||||
raise _exception.ParseError("Could not find sequence id", data=j) from e
|
return int(sequence_id)
|
||||||
|
|
||||||
def _on_connect_handler(self, client, userdata, flags, rc):
|
def _on_connect_handler(self, client, userdata, flags, rc):
|
||||||
if rc == 21:
|
if rc == 21:
|
||||||
@@ -321,6 +321,8 @@ class Listener:
|
|||||||
# This error is wrongly classified
|
# This error is wrongly classified
|
||||||
# See https://github.com/eclipse/paho.mqtt.python/issues/340
|
# See https://github.com/eclipse/paho.mqtt.python/issues/340
|
||||||
log.warning("Connection error, retrying")
|
log.warning("Connection error, retrying")
|
||||||
|
elif rc == paho.mqtt.client.MQTT_ERR_CONN_REFUSED:
|
||||||
|
raise _exception.NotLoggedIn("MQTT connection refused")
|
||||||
else:
|
else:
|
||||||
err = paho.mqtt.client.error_string(rc)
|
err = paho.mqtt.client.error_string(rc)
|
||||||
log.error("MQTT Error: %s", err)
|
log.error("MQTT Error: %s", err)
|
||||||
|
Reference in New Issue
Block a user