1
0
mirror of https://github.com/axllent/mailpit.git synced 2025-07-17 01:32:33 +02:00

Handle errors correctly

This commit is contained in:
Ralph Slooten
2024-06-22 23:56:17 +12:00
parent 19645db2de
commit c7e0455479
3 changed files with 7 additions and 3 deletions

View File

@ -593,7 +593,9 @@ func DeleteMessages(ids []string) error {
}
}
err = tx.Commit()
if err := tx.Commit(); err != nil {
return err
}
dbLastAction = time.Now()
addDeletedSize(int64(totalSize))

View File

@ -137,7 +137,9 @@ func dbApplySchemas() error {
buf := new(bytes.Buffer)
err = t1.Execute(buf, nil)
if err := t1.Execute(buf, nil); err != nil {
return err
}
if _, err := db.Exec(buf.String()); err != nil {
return err

View File

@ -67,7 +67,7 @@ func TestPOP3(t *testing.T) {
return
}
count, size, err = c.Stat()
count, _, err = c.Stat()
if err != nil {
t.Errorf(err.Error())
return