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:
parent
8f30d71806
commit
5d6bfffb6e
|
|
@ -152,6 +152,16 @@ func CallFlatpakSessionHelper() (string, error) {
|
||||||
return path, nil
|
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 {
|
func CreateErrorInvalidRelease(executableBase string) error {
|
||||||
var builder strings.Builder
|
var builder strings.Builder
|
||||||
fmt.Fprintf(&builder, "invalid argument for '--release'\n")
|
fmt.Fprintf(&builder, "invalid argument for '--release'\n")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue