mirror of
https://github.com/grafana/grafana.git
synced 2025-01-10 08:03:58 -06:00
feat(backendsrv): improves error response handling
datasourceRequests that could not reach the destination threw invalid errors due to missing property. This fixes gives the user a better error message. closes #4428
This commit is contained in:
parent
14df3c6249
commit
86a274a7ee
@ -105,6 +105,13 @@ function (angular, _, coreModule, config) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//populate error obj on Internal Error
|
||||||
|
if (_.isString(err.data) && err.status === 500 && !err.data) {
|
||||||
|
err.data = {
|
||||||
|
error: err.statusText
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
// for Prometheus
|
// for Prometheus
|
||||||
if (!err.data.message && _.isString(err.data.error)) {
|
if (!err.data.message && _.isString(err.data.error)) {
|
||||||
err.data.message = err.data.error;
|
err.data.message = err.data.error;
|
||||||
|
Loading…
Reference in New Issue
Block a user