feat: super crude way to throw errors when sending
This commit is contained in:
parent
eac41d01e6
commit
d039f313c6
1 changed files with 6 additions and 2 deletions
|
@ -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()
|
||||||
|
if "event_id" in doc:
|
||||||
self.logger.debug("sent message %s to %s as %s : %s", text, room, mxid, doc)
|
self.logger.debug("sent message %s to %s as %s : %s", text, room, mxid, doc)
|
||||||
return doc["event_id"]
|
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
|
||||||
|
|
Loading…
Reference in a new issue