fix Zabbix API error message
This commit is contained in:
4
dist/datasource-zabbix/datasource.js
vendored
4
dist/datasource-zabbix/datasource.js
vendored
@@ -582,13 +582,13 @@ System.register(['lodash', 'app/core/utils/datemath', './utils', './migrations',
|
||||
return {
|
||||
status: "error",
|
||||
title: error.message,
|
||||
message: error.data
|
||||
message: error.message
|
||||
};
|
||||
} else if (error.data && error.data.message) {
|
||||
return {
|
||||
status: "error",
|
||||
title: "Connection failed",
|
||||
message: error.data.message
|
||||
message: "Connection failed: " + error.data.message
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
|
||||
2
dist/datasource-zabbix/datasource.js.map
vendored
2
dist/datasource-zabbix/datasource.js.map
vendored
File diff suppressed because one or more lines are too long
12
dist/datasource-zabbix/zabbixAPICore.service.js
vendored
12
dist/datasource-zabbix/zabbixAPICore.service.js
vendored
@@ -100,8 +100,6 @@ System.register(['angular'], function (_export, _context) {
|
||||
|
||||
// Success
|
||||
return response.data.result;
|
||||
}).catch(function () {
|
||||
return Promise.reject(new ZabbixAPIError({ data: "Connection Error" }));
|
||||
});
|
||||
}
|
||||
}, {
|
||||
@@ -127,16 +125,16 @@ System.register(['angular'], function (_export, _context) {
|
||||
function ZabbixAPIError(error) {
|
||||
_classCallCheck(this, ZabbixAPIError);
|
||||
|
||||
this.code = error.code;
|
||||
this.name = error.data;
|
||||
this.message = error.data;
|
||||
this.data = error.data;
|
||||
this.code = error.code || null;
|
||||
this.name = error.message || "";
|
||||
this.data = error.data || "";
|
||||
this.message = "Zabbix API Error: " + this.name + " " + this.data;
|
||||
}
|
||||
|
||||
_createClass(ZabbixAPIError, [{
|
||||
key: 'toString',
|
||||
value: function toString() {
|
||||
return this.name + ": " + this.message;
|
||||
return this.name + " " + this.data;
|
||||
}
|
||||
}]);
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
4
dist/test/datasource-zabbix/datasource.js
vendored
4
dist/test/datasource-zabbix/datasource.js
vendored
@@ -466,13 +466,13 @@ var ZabbixAPIDatasource = function () {
|
||||
return {
|
||||
status: "error",
|
||||
title: error.message,
|
||||
message: error.data
|
||||
message: error.message
|
||||
};
|
||||
} else if (error.data && error.data.message) {
|
||||
return {
|
||||
status: "error",
|
||||
title: "Connection failed",
|
||||
message: error.data.message
|
||||
message: "Connection failed: " + error.data.message
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
|
||||
@@ -83,8 +83,6 @@ var ZabbixAPICoreService = function () {
|
||||
|
||||
// Success
|
||||
return response.data.result;
|
||||
}).catch(function () {
|
||||
return Promise.reject(new ZabbixAPIError({ data: "Connection Error" }));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -125,16 +123,16 @@ var ZabbixAPIError = exports.ZabbixAPIError = function () {
|
||||
function ZabbixAPIError(error) {
|
||||
_classCallCheck(this, ZabbixAPIError);
|
||||
|
||||
this.code = error.code;
|
||||
this.name = error.data;
|
||||
this.message = error.data;
|
||||
this.data = error.data;
|
||||
this.code = error.code || null;
|
||||
this.name = error.message || "";
|
||||
this.data = error.data || "";
|
||||
this.message = "Zabbix API Error: " + this.name + " " + this.data;
|
||||
}
|
||||
|
||||
_createClass(ZabbixAPIError, [{
|
||||
key: 'toString',
|
||||
value: function toString() {
|
||||
return this.name + ": " + this.message;
|
||||
return this.name + " " + this.data;
|
||||
}
|
||||
}]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user