mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
API: Datasource endpoint should return 400 bad request if id and orgId is invalid (#32392)
* return 400 bad request if id and orgId is invalid Signed-off-by: bergquist <carl.bergquist@gmail.com> Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
parent
a4b0ad3937
commit
eb241b960f
@ -71,6 +71,9 @@ func GetDataSourceById(c *models.ReqContext) response.Response {
|
||||
if errors.Is(err, models.ErrDataSourceNotFound) {
|
||||
return response.Error(404, "Data source not found", nil)
|
||||
}
|
||||
if errors.Is(err, models.ErrDataSourceIdentifierNotSet) {
|
||||
return response.Error(400, "Datasource id is missing", nil)
|
||||
}
|
||||
return response.Error(500, "Failed to query datasources", err)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user