mirror of
https://github.com/grafana/grafana.git
synced 2026-08-16 16:14:59 -05:00
log error on datasource access denied
This commit is contained in:
@@ -14,7 +14,7 @@ func (hs *HTTPServer) ProxyDataSourceRequest(c *m.ReqContext) {
|
|||||||
ds, err := hs.DatasourceCache.GetDatasource(dsId, c.SignedInUser, c.SkipCache)
|
ds, err := hs.DatasourceCache.GetDatasource(dsId, c.SignedInUser, c.SkipCache)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err == m.ErrDataSourceAccessDenied {
|
if err == m.ErrDataSourceAccessDenied {
|
||||||
c.JsonApiErr(403, "Access denied to datasource", nil)
|
c.JsonApiErr(403, "Access denied to datasource", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
c.JsonApiErr(500, "Unable to load datasource meta data", err)
|
c.JsonApiErr(500, "Unable to load datasource meta data", err)
|
||||||
|
|||||||
+1
-1
@@ -28,7 +28,7 @@ func (hs *HTTPServer) QueryMetrics(c *m.ReqContext, reqDto dtos.MetricRequest) R
|
|||||||
ds, err := hs.DatasourceCache.GetDatasource(datasourceId, c.SignedInUser, c.SkipCache)
|
ds, err := hs.DatasourceCache.GetDatasource(datasourceId, c.SignedInUser, c.SkipCache)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err == m.ErrDataSourceAccessDenied {
|
if err == m.ErrDataSourceAccessDenied {
|
||||||
return Error(403, "Access denied to datasource", nil)
|
return Error(403, "Access denied to datasource", err)
|
||||||
}
|
}
|
||||||
return Error(500, "Unable to load datasource meta data", err)
|
return Error(500, "Unable to load datasource meta data", err)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user