aboutsummaryrefslogtreecommitdiffstats
path: root/commands/msg/forward.go
diff options
context:
space:
mode:
authorMoritz Poldrack <git@moritz.sh>2022-07-29 22:31:54 +0200
committerRobin Jarry <robin@jarry.cc>2022-08-04 21:57:57 +0200
commit5ca6022d007bc83daba1e7297480d37f56554455 (patch)
treecc592d08276b7f0c8db6a4280bb7fb648b2548fe /commands/msg/forward.go
parenta8d631177f4315810f0ab7c7d66d38e332ab0916 (diff)
downloadaerc-5ca6022d007bc83daba1e7297480d37f56554455.tar.gz
lint: ensure errors are at least logged (errcheck)
Signed-off-by: Moritz Poldrack <moritz@poldrack.dev> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'commands/msg/forward.go')
-rw-r--r--commands/msg/forward.go14
1 files changed, 10 insertions, 4 deletions
diff --git a/commands/msg/forward.go b/commands/msg/forward.go
index cd62417c..ddc27910 100644
--- a/commands/msg/forward.go
+++ b/commands/msg/forward.go
@@ -133,14 +133,20 @@ func (forward) Execute(aerc *widgets.Aerc, args []string) error {
store.FetchFull([]uint32{msg.Uid}, func(fm *types.FullMessage) {
tmpFile, err := os.Create(tmpFileName)
if err != nil {
- println(err)
- // TODO: Do something with the error
- addTab()
+ logging.Warnf("failed to create temporary attachment: %v", err)
+ _, err = addTab()
+ if err != nil {
+ logging.Warnf("failed to add tab: %v", err)
+ }
return
}
defer tmpFile.Close()
- io.Copy(tmpFile, fm.Content.Reader)
+ _, err = io.Copy(tmpFile, fm.Content.Reader)
+ if err != nil {
+ logging.Warnf("failed to write to tmpfile: %w", err)
+ return
+ }
composer, err := addTab()
if err != nil {
return