feat: super crude way to throw errors when sending

This commit is contained in:
əlemi 2024-01-29 19:59:44 +01:00
parent eac41d01e6
commit d039f313c6
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -104,8 +104,12 @@ class AppService:
json=mx_message(text), json=mx_message(text),
) as res: ) as res:
doc = await res.json() doc = await res.json()
self.logger.debug("sent message %s to %s as %s : %s", text, room, mxid, doc) if "event_id" in doc:
return doc["event_id"] self.logger.debug("sent message %s to %s as %s : %s", text, room, mxid, doc)
return doc["event_id"]
else:
self.logger.error("failed sending message: %s", doc)
raise ValueError(doc)
async def redact_message(self): async def redact_message(self):
raise NotImplementedError raise NotImplementedError