From 94f1201c8878e6bcab4ee3e894e106f8837c944b Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Mon, 16 Dec 2024 13:49:23 +0100 Subject: [PATCH] chore(plugin): better error msg (#4446) * chore(plugin): better error msg * lint * Update plugin.go Co-authored-by: Danny * Update plugin.go --------- Co-authored-by: Danny (cherry picked from commit 709d52cd8b9432594c0180851707c2df34a2ef9c) --- ignite/cmd/plugin.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ignite/cmd/plugin.go b/ignite/cmd/plugin.go index 80132aec1f..a21fdd8ac3 100644 --- a/ignite/cmd/plugin.go +++ b/ignite/cmd/plugin.go @@ -512,7 +512,11 @@ Respects key value pairs declared after the app path to be added to the generate } defer plugins[0].KillClient() - if plugins[0].Error != nil { + if err := plugins[0].Error; err != nil { + if strings.Contains(err.Error(), "go.mod file not found in current directory") { + return errors.Errorf("unable to find an App at the root of this repository (%s). Please ensure your repository URL is correct. If you're trying to install an App under a subfolder, include the path at the end of your repository URL, e.g., github.com/ignite/apps/appregistry", args[0]) + } + return errors.Errorf("error while loading app %q: %w", args[0], plugins[0].Error) } session.Println(icons.OK, "Done loading apps")