in store/, change functions from calling panic to returning errors

this is a library package, errors should be explicit. callers had to be careful
when calling these "X" functions. now it's explicit.
This commit is contained in:
Mechiel Lukkien
2023-04-20 14:16:56 +02:00
parent 936a0d5afe
commit 08eb1a5472
9 changed files with 173 additions and 165 deletions

View File

@ -128,7 +128,9 @@ func ExportMessages(log *mlog.Log, db *bstore.DB, accountDir string, archiver Ar
name2id := map[string]int64{}
mailboxes, err := bstore.QueryTx[Mailbox](tx).List()
xcheckf(err, "query mailboxes")
if err != nil {
return fmt.Errorf("query mailboxes: %w", err)
}
for _, mb := range mailboxes {
id2name[mb.ID] = mb.Name
name2id[mb.Name] = mb.ID