webui: better error reporting

- ActionDropdownWidget - report error if required action is missing
- report build errors to console

Reviewed-By: Martin Basti <mbasti@redhat.com>
This commit is contained in:
Petr Vobornik 2015-04-22 13:17:25 +02:00
parent cd5fe9b407
commit 847b5fd8d2
4 changed files with 11 additions and 1 deletions

View File

@ -262,7 +262,6 @@ define([
if (error.results) {
var msg = error.results.message;
var stack = error.results.stack.toString();
window.console.error(msg);
window.console.error(stack);
details.append('<h3>Technical details:</h3>');
details.append($('<div/>', { text: error.results.message }));

View File

@ -356,6 +356,7 @@ define(['dojo/_base/declare',
// object is not to be built
obj = null;
} else {
window.console.error(e.stack);
throw e;
}
}

View File

@ -69,6 +69,10 @@ define(['dojo/_base/declare',
obj = this._map[type] = this.builder.build(type);
} catch (e) {
if (e.code === 'no-ctor-fac') obj = null;
else {
window.console.error('Error while building: ' + type);
throw e;
}
}
}

View File

@ -74,6 +74,12 @@ define(['dojo/_base/declare',
for (i=0; i<this.action_names.length; i++) {
name = this.action_names[i];
action = this.facet.actions.get(name);
if (!action) {
window.console.error(
"ActionDropDown: cannot find action: " + name +
"\nFacet: "+facet.name);
continue;
}
this.add_action(action, true);
}
this.recreate_options();