mirror of https://github.com/knative/func.git
chore: improve error message when no func on path (#1739)
Signed-off-by: Matej Vasek <mvasek@redhat.com>
This commit is contained in:
parent
2269aa0f91
commit
62105aa857
|
@ -32,7 +32,7 @@ func (s standardLoaderSaver) Load(path string) (fn.Function, error) {
|
|||
return fn.Function{}, fmt.Errorf("failed to create new function (path: %q): %w", path, err)
|
||||
}
|
||||
if !f.Initialized() {
|
||||
return fn.Function{}, fmt.Errorf("the given path '%v' does not contain an initialized function", path)
|
||||
return fn.Function{}, fmt.Errorf("the given path '%v' does not contain an initialized function", f.Root)
|
||||
}
|
||||
return f, nil
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@ func runDelete(cmd *cobra.Command, args []string, newClient ClientFactory) (err
|
|||
|
||||
// Check if the function has been initialized
|
||||
if !function.Initialized() {
|
||||
return fmt.Errorf("the given path '%v' does not contain an initialized function", cfg.Path)
|
||||
return fmt.Errorf("the given path '%v' does not contain an initialized function", function.Root)
|
||||
}
|
||||
|
||||
// If not provided, use the function's extant namespace
|
||||
|
|
|
@ -74,7 +74,7 @@ func runDescribe(cmd *cobra.Command, args []string, newClient ClientFactory) (er
|
|||
return
|
||||
}
|
||||
if !f.Initialized() {
|
||||
return fmt.Errorf("the given path '%v' does not contain an initialized function.", cfg.Path)
|
||||
return fmt.Errorf("the given path '%v' does not contain an initialized function.", f.Root)
|
||||
}
|
||||
// Use Function's Namespace with precedence
|
||||
//
|
||||
|
|
|
@ -145,7 +145,7 @@ func runInvoke(cmd *cobra.Command, args []string, newClient ClientFactory) (err
|
|||
return
|
||||
}
|
||||
if !f.Initialized() {
|
||||
return fmt.Errorf("'%v' does not contain an initialized function", cfg.Path)
|
||||
return fmt.Errorf("'%v' does not contain an initialized function", f.Root)
|
||||
}
|
||||
|
||||
// Client instance from env vars, flags, args and user prompts (if --confirm)
|
||||
|
|
Loading…
Reference in New Issue