diff --git a/cli/app/deploy.go b/cli/app/deploy.go index fe758a0a..a7e0c8a8 100644 --- a/cli/app/deploy.go +++ b/cli/app/deploy.go @@ -104,7 +104,7 @@ checkout as-is. Recipe commit hashes are also supported as values for toDeployVersion, err = getDeployVersion(args, deployMeta, app) if err != nil { - log.Fatal(i18n.G("get deploy version: %s", err)) + log.Fatal(err) } if !internal.Chaos { @@ -348,7 +348,12 @@ func getDeployVersion(cliArgs []string, deployMeta stack.DeployMeta, app appPkg. // Check if the recipe has a version in the .env file if app.Recipe.EnvVersion != "" && !internal.DeployLatest { if strings.HasSuffix(app.Recipe.EnvVersionRaw, "+U") { - return "", errors.New(i18n.G("version: can not redeploy chaos version %s", app.Recipe.EnvVersionRaw)) + // NOTE(d1): use double-line 5 spaces ("FATA ") trick to make a more + // informative error message. it's ugly but that's our logging situation + // atm + return "", errors.New(i18n.G(`cannot redeploy previous chaos version (%s), did you mean to use "--chaos"? + to return to a regular release, specify a release tag, commit SHA or use "--latest"`, + formatter.BoldDirtyDefault(app.Recipe.EnvVersionRaw))) } log.Debug(i18n.G("version: taking version from .env file: %s", app.Recipe.EnvVersion)) return app.Recipe.EnvVersion, nil diff --git a/pkg/recipe/git.go b/pkg/recipe/git.go index 73b17f2a..e487e011 100644 --- a/pkg/recipe/git.go +++ b/pkg/recipe/git.go @@ -49,7 +49,7 @@ func (r Recipe) Ensure(ctx EnsureContext) error { if r.EnvVersion != "" && !ctx.IgnoreEnvVersion { log.Debug(i18n.G("ensuring env version %s", r.EnvVersion)) if strings.Contains(r.EnvVersion, "+U") { - return errors.New(i18n.G("can not redeploy chaos version (%s) without --chaos", r.EnvVersion)) + return errors.New(i18n.G(`cannot redeploy previous chaos version (%s), did you mean to use "--chaos"?`)) } if _, err := r.EnsureVersion(r.EnvVersion); err != nil {