add utils.UnwrapError() to provide meaningful error messages
This commit is contained in:
@@ -68,7 +68,7 @@ func (b *Bot) Send(ctx context.Context, email *utils.Email) error {
|
||||
content := email2content(email, cfg, threadID)
|
||||
eventID, serr := b.lp.Send(roomID, content)
|
||||
if serr != nil {
|
||||
return serr
|
||||
return utils.UnwrapError(serr)
|
||||
}
|
||||
|
||||
if threadID == "" && !cfg.NoThreads() {
|
||||
|
||||
@@ -112,9 +112,9 @@ func (b *Bot) getSettings(roomID id.RoomID) (settings, error) {
|
||||
}
|
||||
}
|
||||
|
||||
return config, err
|
||||
return config, utils.UnwrapError(err)
|
||||
}
|
||||
|
||||
func (b *Bot) setSettings(roomID id.RoomID, cfg settings) error {
|
||||
return b.lp.GetClient().SetRoomAccountData(roomID, settingskey, cfg)
|
||||
return utils.UnwrapError(b.lp.GetClient().SetRoomAccountData(roomID, settingskey, cfg))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user