mirror of
https://github.com/grafana/grafana.git
synced 2025-07-30 03:02:44 +08:00
Data sources: Improve error messages for grpc errors (#102372)
* Data sources: Improve error messages for grpc errors * Improve code comments * Fix lint * Update connection issue message * Update name * Update comment * Update, rename and add test * Update, remove POC change * Fix lint
This commit is contained in:
@ -172,6 +172,14 @@ func (c *ClientV2) QueryData(ctx context.Context, req *backend.QueryDataRequest)
|
||||
return nil, plugins.ErrMethodNotImplemented
|
||||
}
|
||||
|
||||
if status.Code(err) == codes.Unavailable {
|
||||
return nil, plugins.ErrPluginGrpcConnectionUnavailableBase.Errorf("%v", err)
|
||||
}
|
||||
|
||||
if status.Code(err) == codes.ResourceExhausted {
|
||||
return nil, plugins.ErrPluginGrpcResourceExhaustedBase.Errorf("%v", err)
|
||||
}
|
||||
|
||||
if errorSource, ok := backend.ErrorSourceFromGrpcStatusError(ctx, err); ok {
|
||||
return nil, handleGrpcStatusError(ctx, errorSource, err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user