mirror of
https://github.com/mjl-/mox.git
synced 2025-07-12 12:24:38 +03:00
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:
@ -577,7 +577,7 @@ func serve(listenerName string, cid int64, hostname dns.Domain, tlsConfig *tls.C
|
||||
} else if err, ok := x.(error); ok && isClosed(err) {
|
||||
c.log.Infox("connection closed", err)
|
||||
} else {
|
||||
c.log.Error("unhandled error", mlog.Field("err", x))
|
||||
c.log.Error("unhandled panic", mlog.Field("err", x))
|
||||
debug.PrintStack()
|
||||
metrics.PanicInc("smtpserver")
|
||||
}
|
||||
@ -679,7 +679,7 @@ func command(c *conn) {
|
||||
} else {
|
||||
// Other type of panic, we pass it on, aborting the connection.
|
||||
c.log.Errorx("command panic", err)
|
||||
panic(x)
|
||||
panic(err)
|
||||
}
|
||||
}()
|
||||
|
||||
|
Reference in New Issue
Block a user