diff options
author | Reto Brunner <reto@labrat.space> | 2021-01-30 13:51:32 +0100 |
---|---|---|
committer | Reto Brunner <reto@labrat.space> | 2021-01-30 14:04:23 +0100 |
commit | 8ea86cea41aa038a25a8fee9cd540a7336869dae (patch) | |
tree | 11970859b928dfa06203962b58941e889295edc0 /commands/msg | |
parent | 949781fa0a5f0654112b4f78558347ca991a89d3 (diff) | |
download | aerc-8ea86cea41aa038a25a8fee9cd540a7336869dae.tar.gz |
Get rid of the aerc.PushError(" " + $string) idiom
The individual callers should not be responsible for padding
Diffstat (limited to 'commands/msg')
-rw-r--r-- | commands/msg/archive.go | 2 | ||||
-rw-r--r-- | commands/msg/copy.go | 2 | ||||
-rw-r--r-- | commands/msg/delete.go | 2 | ||||
-rw-r--r-- | commands/msg/modify-labels.go | 2 | ||||
-rw-r--r-- | commands/msg/move.go | 2 | ||||
-rw-r--r-- | commands/msg/pipe.go | 4 | ||||
-rw-r--r-- | commands/msg/read.go | 2 | ||||
-rw-r--r-- | commands/msg/recall.go | 2 |
8 files changed, 9 insertions, 9 deletions
diff --git a/commands/msg/archive.go b/commands/msg/archive.go index 07de13f..59ca985 100644 --- a/commands/msg/archive.go +++ b/commands/msg/archive.go @@ -86,7 +86,7 @@ func (Archive) Execute(aerc *widgets.Aerc, args []string) error { case *types.Done: wg.Done() case *types.Error: - aerc.PushError(" " + msg.Error.Error()) + aerc.PushError(msg.Error.Error()) success = false wg.Done() } diff --git a/commands/msg/copy.go b/commands/msg/copy.go index f3d4030..8e5bad0 100644 --- a/commands/msg/copy.go +++ b/commands/msg/copy.go @@ -60,7 +60,7 @@ func (Copy) Execute(aerc *widgets.Aerc, args []string) error { case *types.Done: aerc.PushStatus("Messages copied.", 10*time.Second) case *types.Error: - aerc.PushError(" " + msg.Error.Error()) + aerc.PushError(msg.Error.Error()) } }) return nil diff --git a/commands/msg/delete.go b/commands/msg/delete.go index 6eb35eb..baa5011 100644 --- a/commands/msg/delete.go +++ b/commands/msg/delete.go @@ -47,7 +47,7 @@ func (Delete) Execute(aerc *widgets.Aerc, args []string) error { case *types.Done: aerc.PushStatus("Messages deleted.", 10*time.Second) case *types.Error: - aerc.PushError(" " + msg.Error.Error()) + aerc.PushError(msg.Error.Error()) case *types.Unsupported: // notmuch doesn't support it, we want the user to know aerc.PushError(" error, unsupported for this worker") diff --git a/commands/msg/modify-labels.go b/commands/msg/modify-labels.go index f91075a..082742b 100644 --- a/commands/msg/modify-labels.go +++ b/commands/msg/modify-labels.go @@ -58,7 +58,7 @@ func (ModifyLabels) Execute(aerc *widgets.Aerc, args []string) error { case *types.Done: aerc.PushStatus("labels updated", 10*time.Second) case *types.Error: - aerc.PushError(" " + msg.Error.Error()) + aerc.PushError(msg.Error.Error()) } }) return nil diff --git a/commands/msg/move.go b/commands/msg/move.go index 41f61da..31e243a 100644 --- a/commands/msg/move.go +++ b/commands/msg/move.go @@ -71,7 +71,7 @@ func (Move) Execute(aerc *widgets.Aerc, args []string) error { case *types.Done: aerc.PushStatus("Message moved to "+joinedArgs, 10*time.Second) case *types.Error: - aerc.PushError(" " + msg.Error.Error()) + aerc.PushError(msg.Error.Error()) } }) return nil diff --git a/commands/msg/pipe.go b/commands/msg/pipe.go index 4e4ba67..0e22fd0 100644 --- a/commands/msg/pipe.go +++ b/commands/msg/pipe.go @@ -75,7 +75,7 @@ func (Pipe) Execute(aerc *widgets.Aerc, args []string) error { doTerm := func(reader io.Reader, name string) { term, err := commands.QuickTerm(aerc, cmd, reader) if err != nil { - aerc.PushError(" " + err.Error()) + aerc.PushError(err.Error()) return } aerc.NewTab(term, name) @@ -93,7 +93,7 @@ func (Pipe) Execute(aerc *widgets.Aerc, args []string) error { }() err = ecmd.Run() if err != nil { - aerc.PushError(" " + err.Error()) + aerc.PushError(err.Error()) } else { if ecmd.ProcessState.ExitCode() != 0 { aerc.PushError(fmt.Sprintf( diff --git a/commands/msg/read.go b/commands/msg/read.go index 325b776..95becf7 100644 --- a/commands/msg/read.go +++ b/commands/msg/read.go @@ -187,7 +187,7 @@ func submitFlagChange(aerc *widgets.Aerc, store *lib.MessageStore, case *types.Done: wg.Done() case *types.Error: - aerc.PushError(" " + msg.Error.Error()) + aerc.PushError(msg.Error.Error()) *success = false wg.Done() } diff --git a/commands/msg/recall.go b/commands/msg/recall.go index b6c7f65..44f8ddf 100644 --- a/commands/msg/recall.go +++ b/commands/msg/recall.go @@ -86,7 +86,7 @@ func (Recall) Execute(aerc *widgets.Aerc, args []string) error { }, func(msg types.WorkerMessage) { switch msg := msg.(type) { case *types.Error: - aerc.PushError(" " + msg.Error.Error()) + aerc.PushError(msg.Error.Error()) composer.Close() } }) |