add utils.UnwrapError() to provide meaningful error messages

This commit is contained in:
Aine
2022-08-27 22:38:23 +03:00
parent d1c48b9b31
commit 6eae1a65c4
3 changed files with 30 additions and 3 deletions

View File

@@ -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))
}