You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am not sure if just changing the return value would help here. Ideally when I use errorsource middleware or htpp client I would like error source to be handled automatically, but at the same time I want to be able to access the response if there is response. The problem with the current approach is that response is lost when status code is >= 400. Maybe we need to extend/override http client later in the chain or use some other approach to achieve the desired result.
It seems not ideal that the errorsource's round tripper returns custom generated error together with the response for certain status codes here: https://github.com/grafana/grafana-plugin-sdk-go/blob/main/experimental/errorsource/error_source_middleware.go#L21-L26
Because the Go http client ignores the response in case round tripper returns the error: https://github.com/golang/go/blob/6fe0d3758b35afcc342832e376d8d985a5a29070/src/net/http/client.go#L262-L264.
The response body might contain useful information for the user.
cc @scottlepp
The text was updated successfully, but these errors were encountered: