mirror of
https://github.com/grafana/grafana.git
synced 2025-08-01 08:13:47 +08:00
Bug Fix: Restore health check error (#75508)
This commit is contained in:

committed by
GitHub

parent
d24dc7f156
commit
af8a46adbb
@ -18,6 +18,12 @@ var (
|
|||||||
// ErrMethodNotImplemented error returned when a plugin method is not implemented.
|
// ErrMethodNotImplemented error returned when a plugin method is not implemented.
|
||||||
ErrMethodNotImplemented = errMethodNotImplementedBase.Errorf("method not implemented")
|
ErrMethodNotImplemented = errMethodNotImplementedBase.Errorf("method not implemented")
|
||||||
|
|
||||||
|
// ErrPluginHealthCheck error returned when a plugin fails its health check.
|
||||||
|
// Exposed as a base error to wrap it with plugin error.
|
||||||
|
ErrPluginHealthCheck = errutil.Internal("plugin.healthCheck",
|
||||||
|
errutil.WithPublicMessage("Plugin health check failed"),
|
||||||
|
errutil.WithDownstream())
|
||||||
|
|
||||||
// ErrPluginDownstreamError error returned when a plugin request fails.
|
// ErrPluginDownstreamError error returned when a plugin request fails.
|
||||||
// Exposed as a base error to wrap it with plugin downstream errors.
|
// Exposed as a base error to wrap it with plugin downstream errors.
|
||||||
ErrPluginDownstreamErrorBase = errutil.Internal("plugin.downstreamError",
|
ErrPluginDownstreamErrorBase = errutil.Internal("plugin.downstreamError",
|
||||||
|
@ -188,7 +188,7 @@ func (s *Service) CheckHealth(ctx context.Context, req *backend.CheckHealthReque
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, plugins.ErrPluginDownstreamErrorBase.Errorf("client: failed to check health: %w", err)
|
return nil, plugins.ErrPluginHealthCheck.Errorf("client: failed to check health: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return resp, nil
|
return resp, nil
|
||||||
|
@ -97,7 +97,7 @@ func TestCheckHealth(t *testing.T) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
err: errors.New("surprise surprise"),
|
err: errors.New("surprise surprise"),
|
||||||
expectedError: plugins.ErrPluginDownstreamErrorBase,
|
expectedError: plugins.ErrPluginHealthCheck,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user