mirror of
https://github.com/grafana/grafana.git
synced 2025-01-06 14:13:11 -06:00
style(cli): add some color to error messages
This commit is contained in:
parent
0855f51436
commit
07b13e24fa
@ -4,6 +4,7 @@ import (
|
||||
"os"
|
||||
|
||||
"github.com/codegangsta/cli"
|
||||
"github.com/fatih/color"
|
||||
"github.com/grafana/grafana/pkg/cmd/grafana-cli/log"
|
||||
)
|
||||
|
||||
@ -12,7 +13,7 @@ func runCommand(command func(commandLine CommandLine) error) func(context *cli.C
|
||||
|
||||
cmd := &contextCommandLine{context}
|
||||
if err := command(cmd); err != nil {
|
||||
log.Error("\nError: ")
|
||||
log.Errorf("\n%s: ", color.RedString("Error"))
|
||||
log.Errorf("%s\n\n", err)
|
||||
|
||||
cmd.ShowHelp()
|
||||
|
@ -132,7 +132,7 @@ func downloadFile(pluginName, filePath, url string) (err error) {
|
||||
} else {
|
||||
failure := fmt.Sprintf("%v", r)
|
||||
if failure == "runtime error: makeslice: len out of range" {
|
||||
err = fmt.Errorf("Failed to extract zipped HTTP response. Please try again.\n")
|
||||
err = fmt.Errorf("Corrupt http response from source. Please try again.\n")
|
||||
} else {
|
||||
panic(r)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user