diff options
author | Moritz Poldrack <git@moritz.sh> | 2022-07-29 22:31:54 +0200 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-08-04 21:57:57 +0200 |
commit | 5ca6022d007bc83daba1e7297480d37f56554455 (patch) | |
tree | cc592d08276b7f0c8db6a4280bb7fb648b2548fe /commands/msg/forward.go | |
parent | a8d631177f4315810f0ab7c7d66d38e332ab0916 (diff) | |
download | aerc-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.go | 14 |
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 |