Get rid of the aerc.PushError(" " + $string) idiom
The individual callers should not be responsible for padding
This commit is contained in:
parent
949781fa0a
commit
8ea86cea41
18 changed files with 29 additions and 29 deletions
commands/compose
|
@ -34,13 +34,13 @@ func (Attach) Execute(aerc *widgets.Aerc, args []string) error {
|
|||
|
||||
path, err := homedir.Expand(path)
|
||||
if err != nil {
|
||||
aerc.PushError(" " + err.Error())
|
||||
aerc.PushError(err.Error())
|
||||
return err
|
||||
}
|
||||
|
||||
pathinfo, err := os.Stat(path)
|
||||
if err != nil {
|
||||
aerc.PushError(" " + err.Error())
|
||||
aerc.PushError(err.Error())
|
||||
return err
|
||||
} else if pathinfo.IsDir() {
|
||||
aerc.PushError("Attachment must be a file, not a directory")
|
||||
|
|
|
@ -63,7 +63,7 @@ func (Postpone) Execute(aerc *widgets.Aerc, args []string) error {
|
|||
go func() {
|
||||
errStr := <-errChan
|
||||
if errStr != "" {
|
||||
aerc.PushError(" " + errStr)
|
||||
aerc.PushError(errStr)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -90,7 +90,7 @@ func (Postpone) Execute(aerc *widgets.Aerc, args []string) error {
|
|||
r.Close()
|
||||
composer.Close()
|
||||
case *types.Error:
|
||||
aerc.PushError(" " + msg.Error.Error())
|
||||
aerc.PushError(msg.Error.Error())
|
||||
r.Close()
|
||||
composer.Close()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue