log error on datasource access denied

This commit is contained in:
Marcus Efraimsson
2018-10-26 18:34:10 +02:00
parent 70ddf93688
commit 52d825f535
2 changed files with 2 additions and 2 deletions

View File

@@ -14,7 +14,7 @@ func (hs *HTTPServer) ProxyDataSourceRequest(c *m.ReqContext) {
ds, err := hs.DatasourceCache.GetDatasource(dsId, c.SignedInUser, c.SkipCache)
if err != nil {
if err == m.ErrDataSourceAccessDenied {
c.JsonApiErr(403, "Access denied to datasource", nil)
c.JsonApiErr(403, "Access denied to datasource", err)
return
}
c.JsonApiErr(500, "Unable to load datasource meta data", err)

View File

@@ -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)
if err != nil {
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)
}