diff options
author | Robin Jarry <robin@jarry.cc> | 2023-01-06 22:49:26 +0100 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2023-01-06 23:51:58 +0100 |
commit | 915b869e3fc6377be114c033763987de612c443c (patch) | |
tree | 95a2165a06cbda9ad0d092ac1b3816f50daa52c1 /worker/notmuch/worker.go | |
parent | 175c1c822084d0f42892729c8e095397bd830966 (diff) | |
download | aerc-915b869e3fc6377be114c033763987de612c443c.tar.gz |
lint: add missing panic handlers in goroutines
These issues were all reported by the new custom analyzer introduced in
previous commit.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
Diffstat (limited to 'worker/notmuch/worker.go')
-rw-r--r-- | worker/notmuch/worker.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/worker/notmuch/worker.go b/worker/notmuch/worker.go index 6d8e46d2..3b4bd5dc 100644 --- a/worker/notmuch/worker.go +++ b/worker/notmuch/worker.go @@ -688,6 +688,7 @@ func (w *worker) sort(uids []uint32, } func (w *worker) handleCheckMail(msg *types.CheckMail) { + defer log.PanicHandler() if msg.Command == "" { w.err(msg, fmt.Errorf("checkmail: no command specified")) return @@ -697,6 +698,7 @@ func (w *worker) handleCheckMail(msg *types.CheckMail) { cmd := exec.CommandContext(ctx, "sh", "-c", msg.Command) ch := make(chan error) go func() { + defer log.PanicHandler() err := cmd.Run() ch <- err }() |