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:
Ivana Huckova
2025-03-20 18:44:47 +01:00
committed by GitHub
parent 3ef583aa05
commit 307974f20d
4 changed files with 62 additions and 17 deletions

View File

@ -35,4 +35,16 @@ var (
// Exposed as a base error to wrap it with plugin cancelled errors.
ErrPluginRequestCanceledErrorBase = errutil.ClientClosedRequest("plugin.requestCanceled",
errutil.WithPublicMessage("Plugin request canceled"))
// ErrPluginGrpcResourceExhaustedBase error returned when a plugin response is larger than the grpc limit.
// Exposed as a base error to wrap it with plugin resource exhausted errors.
ErrPluginGrpcResourceExhaustedBase = errutil.Internal("plugin.resourceExhausted",
errutil.WithPublicMessage("The response is too large. Please try to reduce the time range or narrow down your query to return fewer data points."),
errutil.WithDownstream())
// ErrPluginGrpcConnectionUnavailableBase error returned when a plugin connection issue occurs.
// Exposed as a base error to wrap it with plugin connection issue errors.
ErrPluginGrpcConnectionUnavailableBase = errutil.Internal("plugin.connectionUnavailable",
errutil.WithPublicMessage("Data source became unavailable during request. Please try again."),
errutil.WithDownstream())
)