Fix errors without templates not working

This commit is contained in:
SilentSpike
2019-02-04 17:55:44 +00:00
parent d7147996ed
commit ddf44377e8

View File

@@ -40,14 +40,18 @@ _extend(qaError.prototype, {
}
}
if (this.service) {
this.source = services[this.service].shortName;
// Extract common error information from data
if (this.service && this.error_type) {
var serviceInfo = services[this.service];
if (this.error_type) {
var template = services[this.service].errorTypes[this.error_type];
if (serviceInfo) {
var errInfo = serviceInfo.errorTypes[this.error_type];
this.icon = template.icon;
this.category = template.category;
this.source = serviceInfo.shortName;
if (errInfo) {
this.icon = errInfo.icon;
this.category = errInfo.category;
}
}
}