mirror of
https://github.com/grafana/grafana.git
synced 2024-11-25 18:30:41 -06:00
DataSource: change status code to 404 if datasource and plugin is not found (#36426)
Fixes #36418
This commit is contained in:
parent
4932b9dfa4
commit
f62bc59688
@ -46,6 +46,10 @@ func (p *DatasourceProxyService) ProxyDatasourceRequestWithID(c *models.ReqConte
|
||||
c.JsonApiErr(http.StatusForbidden, "Access denied to datasource", err)
|
||||
return
|
||||
}
|
||||
if errors.Is(err, models.ErrDataSourceNotFound) {
|
||||
c.JsonApiErr(http.StatusNotFound, "Unable to find datasource", err)
|
||||
return
|
||||
}
|
||||
c.JsonApiErr(http.StatusInternalServerError, "Unable to load datasource meta data", err)
|
||||
return
|
||||
}
|
||||
@ -59,7 +63,7 @@ func (p *DatasourceProxyService) ProxyDatasourceRequestWithID(c *models.ReqConte
|
||||
// find plugin
|
||||
plugin := p.PluginManager.GetDataSource(ds.Type)
|
||||
if plugin == nil {
|
||||
c.JsonApiErr(http.StatusInternalServerError, "Unable to find datasource plugin", err)
|
||||
c.JsonApiErr(http.StatusNotFound, "Unable to find datasource plugin", err)
|
||||
return
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user