mirror of
https://gitlab.com/psuapp/psu.git
synced 2024-08-30 18:12:34 +00:00
Add suggestions to FatalLevel log messages
This commit is contained in:
parent
1f78446a6f
commit
4c2d66e7b4
@ -28,7 +28,8 @@ var configCmd = &cobra.Command{
|
|||||||
}
|
}
|
||||||
if !keyExists {
|
if !keyExists {
|
||||||
logrus.WithFields(logrus.Fields{
|
logrus.WithFields(logrus.Fields{
|
||||||
"key": args[0],
|
"key": args[0],
|
||||||
|
"suggestions": "Try looking up the available configuration keys: psu config ls --keys",
|
||||||
}).Fatal("Unknown configuration key")
|
}).Fatal("Unknown configuration key")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
"github.com/greenled/portainer-stack-utils/client"
|
"github.com/greenled/portainer-stack-utils/client"
|
||||||
"github.com/greenled/portainer-stack-utils/common"
|
"github.com/greenled/portainer-stack-utils/common"
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
@ -82,8 +84,9 @@ var stackRemoveCmd = &cobra.Command{
|
|||||||
}).Debug("Stack not found")
|
}).Debug("Stack not found")
|
||||||
if viper.GetBool("stack.remove.strict") {
|
if viper.GetBool("stack.remove.strict") {
|
||||||
logrus.WithFields(logrus.Fields{
|
logrus.WithFields(logrus.Fields{
|
||||||
"stack": stackName,
|
"stack": stackName,
|
||||||
"endpoint": endpointId,
|
"endpoint": endpointId,
|
||||||
|
"suggestions": fmt.Sprintf("Try with a different endpoint: psu stack rm %s --endpoint ENDPOINT_ID", stackName),
|
||||||
}).Fatal("Stack does not exist")
|
}).Fatal("Stack does not exist")
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
Loading…
Reference in New Issue
Block a user