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:
@ -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))
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user