Remove ErrorMsg

There is no reason any more for application code to show error messages in a
panel. Just return an error instead.
This commit is contained in:
Stefan Haller 2024-04-15 08:25:17 +02:00
parent 723b92916d
commit caad553502
27 changed files with 98 additions and 73 deletions

View file

@ -1,6 +1,7 @@
package custom_commands
import (
"errors"
"fmt"
"strings"
"text/template"
@ -103,7 +104,7 @@ func (self *HandlerCreator) call(customCommand config.CustomCommand) func() erro
return self.confirmPrompt(resolvedPrompt, g)
}
default:
return self.c.ErrorMsg("custom command prompt must have a type of 'input', 'menu', 'menuFromCommand', or 'confirm'")
return errors.New("custom command prompt must have a type of 'input', 'menu', 'menuFromCommand', or 'confirm'")
}
}