mirror of
https://github.com/grafana/grafana.git
synced 2025-07-31 22:12:34 +08:00
pkg/cmd: Check errors (#19700)
* pkg/cmd: Check errors * pkg/cmd: Make sure server waits on services, even in case of error * pkg/cmd: Inform of error to show help * pkg/cmd: Only warn on failure to send systemd notification * pkg/cmd: Don't log errors stemming from context cancelation * pkg/cmd: Don't fail if unable to write to systemd
This commit is contained in:
@ -5,6 +5,7 @@ import (
|
||||
"github.com/grafana/grafana/pkg/cmd/grafana-cli/logger"
|
||||
s "github.com/grafana/grafana/pkg/cmd/grafana-cli/services"
|
||||
"github.com/grafana/grafana/pkg/cmd/grafana-cli/utils"
|
||||
"github.com/grafana/grafana/pkg/util/errutil"
|
||||
)
|
||||
|
||||
func upgradeCommand(c utils.CommandLine) error {
|
||||
@ -24,7 +25,10 @@ func upgradeCommand(c utils.CommandLine) error {
|
||||
}
|
||||
|
||||
if shouldUpgrade(localPlugin.Info.Version, &plugin) {
|
||||
s.RemoveInstalledPlugin(pluginsDir, pluginName)
|
||||
if err := s.RemoveInstalledPlugin(pluginsDir, pluginName); err != nil {
|
||||
return errutil.Wrapf(err, "Failed to remove plugin '%s'", pluginName)
|
||||
}
|
||||
|
||||
return InstallPlugin(pluginName, "", c)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user