Serialize an elasticsearch error previously printed as 'Object'

This commit is contained in:
Gueust 2016-01-26 23:15:54 +01:00
parent 4b59cee17a
commit 269583a6a1

View File

@ -146,7 +146,7 @@ function (angular, _, moment, kbn, ElasticQueryBuilder, IndexPattern, ElasticRes
return { status: "success", message: "Data source is working", title: "Success" };
}, function(err) {
if (err.data && err.data.error) {
return { status: "error", message: err.data.error, title: "Error" };
return { status: "error", message: angular.toJson(err.data.error), title: "Error" };
} else {
return { status: "error", message: err.status, title: "Error" };
}