Chore: Handle wrapped errors (#29223)

* Chore: Handle wrapped errors

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
This commit is contained in:
Arve Knudsen
2020-11-19 13:34:28 +01:00
committed by GitHub
parent 0cb29d337a
commit 294770f411
34 changed files with 153 additions and 124 deletions

View File

@@ -18,7 +18,7 @@ func (hs *HTTPServer) ProxyDataSourceRequest(c *models.ReqContext) {
dsID := c.ParamsInt64(":id")
ds, err := hs.DatasourceCache.GetDatasource(dsID, c.SignedInUser, c.SkipCache)
if err != nil {
if err == models.ErrDataSourceAccessDenied {
if errors.Is(err, models.ErrDataSourceAccessDenied) {
c.JsonApiErr(403, "Access denied to datasource", err)
return
}