Skip to content

Commit 9bfc688

Browse files
committed
improve error message for func describe and guide users correctly
Signed-off-by: RayyanSeliya <[email protected]>
1 parent cd6c388 commit 9bfc688

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

cmd/describe.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package cmd
33
import (
44
"encoding/json"
55
"encoding/xml"
6-
"errors"
76
"fmt"
87
"io"
98
"os"
@@ -83,7 +82,7 @@ func runDescribe(cmd *cobra.Command, args []string, newClient ClientFactory) (er
8382
return err
8483
}
8584
if !f.Initialized() {
86-
return errors.New("function not found at this path and no name provided")
85+
return fmt.Errorf("no function found in current directory.\nYou need to be inside a function directory to get the function description.\n\nTry this:\n func create --language go myfunction Create a new function\n cd myfunction Go into the function directory\n func describe Show function description\n\nOr if you have an existing function:\n cd path/to/your/function Go to your function directory\n func describe Show function description")
8786
}
8887
details, err = client.Describe(cmd.Context(), "", "", f)
8988
if err != nil {

0 commit comments

Comments
 (0)