Update http error code when datasource health check fails (#37895)

Since the datasource settings are configured by the user, the health check error could be a client error. A 506 error may be sufficient as well.
This commit is contained in:
Stephanie Hingtgen 2021-08-16 00:49:34 -06:00 committed by GitHub
parent 15edaa5837
commit db2e0d46b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -477,7 +477,7 @@ func (hs *HTTPServer) CheckDatasourceHealth(c *models.ReqContext) response.Respo
}
if resp.Status != backend.HealthStatusOk {
return response.JSON(503, payload)
return response.JSON(400, payload)
}
return response.JSON(200, payload)