Send error message if downloading media from WhatsApp fails

This commit is contained in:
Tulir Asokan 2019-08-24 23:08:45 +03:00
parent 2c89089650
commit f28322d1f7

View file

@ -906,6 +906,12 @@ func (portal *Portal) HandleMediaMessage(source *User, download func() ([]byte,
data, err := download()
if err != nil {
portal.log.Errorfln("Failed to download media for %s: %v", info.Id, err)
resp, err := portal.MainIntent().SendNotice(portal.MXID, "Failed to bridge media")
if err != nil {
portal.log.Errorfln("Failed to send media download error message for %s: %v", info.Id, err)
} else {
portal.finishHandling(source, info.Source, resp.EventID)
}
return
}