diff --git a/internal/cli/apps.go b/internal/cli/apps.go index 0843b99b0..93c79001d 100644 --- a/internal/cli/apps.go +++ b/internal/cli/apps.go @@ -54,7 +54,7 @@ Lists your existing applications. To create one try: }) if err != nil { - return err + return fmt.Errorf("An unexpected error occurred: %w", err) } cli.renderer.ApplicationList(list.Clients) @@ -87,10 +87,10 @@ auth0 apps show input := prompt.TextInput(appID, "Id:", "Id of the application.", true) if err := prompt.AskOne(input, &inputs); err != nil { - return err + return fmt.Errorf("An unexpected error occurred: %w", err) } } else { - return errors.New("missing application id") + return errors.New("Please provide an application id") } } else { inputs.ID = args[0] @@ -105,7 +105,7 @@ auth0 apps show }) if err != nil { - return err + return fmt.Errorf("Unable to load application. The id %v specified doesn't exist", inputs.ID) } revealClientSecret := auth0.StringValue(a.AppType) != "native" && auth0.StringValue(a.AppType) != "spa" @@ -139,10 +139,10 @@ auth0 apps delete input := prompt.TextInput(appID, "Id:", "Id of the application.", true) if err := prompt.AskOne(input, &inputs); err != nil { - return err + return fmt.Errorf("An unexpected error occurred: %w", err) } } else { - return errors.New("missing application id") + return errors.New("Please provide an application id") } } else { inputs.ID = args[0] @@ -190,7 +190,7 @@ auth0 apps create --name myapp --type [native|spa|regular|m2m] true) if err := prompt.AskOne(input, &flags); err != nil { - return err + return fmt.Errorf("An unexpected error occurred: %w", err) } } @@ -206,7 +206,7 @@ auth0 apps create --name myapp --type [native|spa|regular|m2m] true) if err := prompt.AskOne(input, &flags); err != nil { - return err + return fmt.Errorf("An unexpected error occurred: %w", err) } } @@ -214,7 +214,7 @@ auth0 apps create --name myapp --type [native|spa|regular|m2m] input := prompt.TextInput(appDescription, "Description:", "Description of the application.", false) if err := prompt.AskOne(input, &flags); err != nil { - return err + return fmt.Errorf("An unexpected error occurred: %w", err) } } @@ -231,7 +231,7 @@ auth0 apps create --name myapp --type [native|spa|regular|m2m] }) if err != nil { - return err + return fmt.Errorf("Unable to create application: %w", err) } // note: c is populated with the rest of the client fields by the API during creation. @@ -283,10 +283,10 @@ auth0 apps update --name myapp --type [native|spa|regular|m2m] input := prompt.TextInput(appID, "Id:", "Id of the application.", true) if err := prompt.AskOne(input, &inputs); err != nil { - return err + return fmt.Errorf("An unexpected error occurred: %w", err) } } else { - return errors.New("missing application id") + return errors.New("Please provide an application id") } } else { inputs.ID = args[0] @@ -296,7 +296,7 @@ auth0 apps update --name myapp --type [native|spa|regular|m2m] input := prompt.TextInput(appName, "Name:", "Name of the application", true) if err := prompt.AskOne(input, &inputs); err != nil { - return err + return fmt.Errorf("An unexpected error occurred: %w", err) } } @@ -312,7 +312,7 @@ auth0 apps update --name myapp --type [native|spa|regular|m2m] true) if err := prompt.AskOne(input, &inputs); err != nil { - return err + return fmt.Errorf("An unexpected error occurred: %w", err) } } @@ -320,7 +320,7 @@ auth0 apps update --name myapp --type [native|spa|regular|m2m] input := prompt.TextInput(appDescription, "Description:", "Description of the application.", false) if err := prompt.AskOne(input, &inputs); err != nil { - return err + return fmt.Errorf("An unexpected error occurred: %w", err) } } @@ -337,7 +337,7 @@ auth0 apps update --name myapp --type [native|spa|regular|m2m] }) if err != nil { - return err + return fmt.Errorf("Unable to update application %v: %v", inputs.ID, err) } // note: c is populated with the rest of the client fields by the API during creation.