handle failed messages
Browse files- App/Android/Android.py +6 -3
App/Android/Android.py
CHANGED
@@ -56,7 +56,7 @@ class AndroidClient:
|
|
56 |
try:
|
57 |
data = response.json()
|
58 |
except:
|
59 |
-
return
|
60 |
if "active_users" in data:
|
61 |
active_users = data["active_users"]
|
62 |
|
@@ -122,8 +122,11 @@ class AndroidClient:
|
|
122 |
"event": event,
|
123 |
}
|
124 |
response = await self.client.post("/send_message", json=data)
|
125 |
-
|
126 |
-
|
|
|
|
|
|
|
127 |
|
128 |
async def close(self):
|
129 |
"""Close the client session."""
|
|
|
56 |
try:
|
57 |
data = response.json()
|
58 |
except:
|
59 |
+
return None
|
60 |
if "active_users" in data:
|
61 |
active_users = data["active_users"]
|
62 |
|
|
|
122 |
"event": event,
|
123 |
}
|
124 |
response = await self.client.post("/send_message", json=data)
|
125 |
+
x = response.content
|
126 |
+
if response.status_code < 200 or response.status_code >= 300:
|
127 |
+
return response
|
128 |
+
else:
|
129 |
+
raise Exception(f"Error sending message : {x}")
|
130 |
|
131 |
async def close(self):
|
132 |
"""Close the client session."""
|