pkg/utils: Add function to show an error when a container is missing

https://github.com/containers/toolbox/pull/318
This commit is contained in:
Harry Míchal 2020-04-28 16:50:32 +02:00 committed by Debarshi Ray
parent 8f30d71806
commit 5d6bfffb6e
1 changed files with 10 additions and 0 deletions

View File

@ -152,6 +152,16 @@ func CallFlatpakSessionHelper() (string, error) {
return path, nil
}
func CreateErrorContainerNotFound(container, executableBase string) error {
var builder strings.Builder
fmt.Fprintf(&builder, "container %s not found\n", container)
fmt.Fprintf(&builder, "Use the 'create' command to create a toolbox.\n")
fmt.Fprintf(&builder, "Run '%s --help' for usage.", executableBase)
errMsg := builder.String()
return errors.New(errMsg)
}
func CreateErrorInvalidRelease(executableBase string) error {
var builder strings.Builder
fmt.Fprintf(&builder, "invalid argument for '--release'\n")