mirror of
https://github.com/mjl-/mox.git
synced 2024-12-27 08:53:48 +03:00
better error message if import fails, only stack traces for unexpected panics (i.e. not the special sential panic value)
This commit is contained in:
parent
9b3a170cc2
commit
eda907fc86
1 changed files with 8 additions and 4 deletions
|
@ -199,9 +199,13 @@ func importctl(ctl *ctl, mbox bool) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
ctl.log.Error("store error", mlog.Field("panic", x))
|
if x != ctl.x {
|
||||||
|
ctl.log.Error("import error", mlog.Field("panic", fmt.Errorf("%v", x)))
|
||||||
debug.PrintStack()
|
debug.PrintStack()
|
||||||
metrics.PanicInc("import")
|
metrics.PanicInc("import")
|
||||||
|
} else {
|
||||||
|
ctl.log.Error("import error")
|
||||||
|
}
|
||||||
|
|
||||||
for _, id := range deliveredIDs {
|
for _, id := range deliveredIDs {
|
||||||
p := a.MessagePath(id)
|
p := a.MessagePath(id)
|
||||||
|
@ -209,7 +213,7 @@ func importctl(ctl *ctl, mbox bool) {
|
||||||
ctl.log.Check(err, "closing message file after import error", mlog.Field("path", p))
|
ctl.log.Check(err, "closing message file after import error", mlog.Field("path", p))
|
||||||
}
|
}
|
||||||
|
|
||||||
ctl.xerror(fmt.Sprintf("%v", x))
|
ctl.xerror(fmt.Sprintf("import error: %v", x))
|
||||||
}()
|
}()
|
||||||
|
|
||||||
var changes []store.Change
|
var changes []store.Change
|
||||||
|
|
Loading…
Reference in a new issue