aboutsummaryrefslogtreecommitdiffstats
path: root/commands/msgview
diff options
context:
space:
mode:
authorRobin Jarry <robin@jarry.cc>2023-01-06 22:49:26 +0100
committerRobin Jarry <robin@jarry.cc>2023-01-06 23:51:58 +0100
commit915b869e3fc6377be114c033763987de612c443c (patch)
tree95a2165a06cbda9ad0d092ac1b3816f50daa52c1 /commands/msgview
parent175c1c822084d0f42892729c8e095397bd830966 (diff)
downloadaerc-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 'commands/msgview')
-rw-r--r--commands/msgview/open-link.go2
-rw-r--r--commands/msgview/open.go2
2 files changed, 4 insertions, 0 deletions
diff --git a/commands/msgview/open-link.go b/commands/msgview/open-link.go
index d19dfae0..257a2fdc 100644
--- a/commands/msgview/open-link.go
+++ b/commands/msgview/open-link.go
@@ -5,6 +5,7 @@ import (
"git.sr.ht/~rjarry/aerc/commands"
"git.sr.ht/~rjarry/aerc/lib"
+ "git.sr.ht/~rjarry/aerc/log"
"git.sr.ht/~rjarry/aerc/widgets"
)
@@ -33,6 +34,7 @@ func (OpenLink) Execute(aerc *widgets.Aerc, args []string) error {
return errors.New("Usage: open-link <url>")
}
go func() {
+ defer log.PanicHandler()
if err := lib.XDGOpen(args[1]); err != nil {
aerc.PushError("open-link: " + err.Error())
}
diff --git a/commands/msgview/open.go b/commands/msgview/open.go
index 1b9efb38..0380b51a 100644
--- a/commands/msgview/open.go
+++ b/commands/msgview/open.go
@@ -7,6 +7,7 @@ import (
"os"
"git.sr.ht/~rjarry/aerc/lib"
+ "git.sr.ht/~rjarry/aerc/log"
"git.sr.ht/~rjarry/aerc/widgets"
)
@@ -57,6 +58,7 @@ func (Open) Execute(aerc *widgets.Aerc, args []string) error {
}
go func() {
+ defer log.PanicHandler()
err = lib.XDGOpenMime(tmpFile.Name(), mimeType, args[1:])
if err != nil {
aerc.PushError("open: " + err.Error())