diff options
Diffstat (limited to 'commands/msg/pipe.go')
-rw-r--r-- | commands/msg/pipe.go | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/commands/msg/pipe.go b/commands/msg/pipe.go index 176d1f0d..7a2489a2 100644 --- a/commands/msg/pipe.go +++ b/commands/msg/pipe.go @@ -96,7 +96,10 @@ func (Pipe) Execute(aerc *widgets.Aerc, args []string) error { defer logging.PanicHandler() defer pipe.Close() - io.Copy(pipe, reader) + _, err := io.Copy(pipe, reader) + if err != nil { + logging.Errorf("failed to send data to pipe: %w", err) + } }() err = ecmd.Run() if err != nil { @@ -224,10 +227,14 @@ func newMessagesReader(messages []*types.FullMessage, useMbox bool) io.Reader { go func() { defer pw.Close() for _, msg := range messages { + var err error if useMbox { - mboxer.Write(pw, msg.Content.Reader, "", time.Now()) + err = mboxer.Write(pw, msg.Content.Reader, "", time.Now()) } else { - io.Copy(pw, msg.Content.Reader) + _, err = io.Copy(pw, msg.Content.Reader) + } + if err != nil { + logging.Warnf("failed to write data: %v", err) } } }() |