summaryrefslogtreecommitdiffstats
path: root/install/ui/src/freeipa/Application_controller.js
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2013-04-12 17:21:24 +0200
committerPetr Vobornik <pvoborni@redhat.com>2013-05-06 16:22:25 +0200
commit952234ef79e1431773d3f3f35d71a7a12a229d5f (patch)
tree9206e935507cabd7b9fd5eb4871594580d07b733 /install/ui/src/freeipa/Application_controller.js
parent9f0188684fc970404d660b85e557135d103c3e73 (diff)
downloadfreeipa-952234ef79e1431773d3f3f35d71a7a12a229d5f.tar.gz
freeipa-952234ef79e1431773d3f3f35d71a7a12a229d5f.tar.xz
freeipa-952234ef79e1431773d3f3f35d71a7a12a229d5f.zip
Report phase errors
https://fedorahosted.org/freeipa/ticket/3235
Diffstat (limited to 'install/ui/src/freeipa/Application_controller.js')
-rw-r--r--install/ui/src/freeipa/Application_controller.js29
1 files changed, 22 insertions, 7 deletions
diff --git a/install/ui/src/freeipa/Application_controller.js b/install/ui/src/freeipa/Application_controller.js
index 8ce853e73..7f62159a0 100644
--- a/install/ui/src/freeipa/Application_controller.js
+++ b/install/ui/src/freeipa/Application_controller.js
@@ -24,7 +24,8 @@
* Controls interaction between navigation, menu and facets.
*/
-define(['dojo/_base/declare',
+define([
+ 'dojo/_base/declare',
'dojo/_base/lang',
'dojo/_base/array',
'dojo/Deferred',
@@ -32,6 +33,7 @@ define(['dojo/_base/declare',
'dojo/topic',
'dojo/query',
'dojo/dom-class',
+ './json2',
'./widgets/App',
'./ipa',
'./navigation/Menu',
@@ -39,7 +41,7 @@ define(['dojo/_base/declare',
'./navigation/menu_spec'
],
function(declare, lang, array, Deferred, on, topic, query, dom_class,
- App_widget, IPA, Menu, Router, menu_spec) {
+ JSON, App_widget, IPA, Menu, Router, menu_spec) {
/**
* Main application
@@ -176,11 +178,24 @@ define(['dojo/_base/declare',
},
on_phase_error: function(error) {
- // FIXME: CHANGE!!!
- window.alert('Initialization error, have a coffee and relax.');
-// var container = $('#content').empty();
-// container.append('<p>Error: '+error_thrown.name+'</p>');
-// container.append('<p>'+error_thrown.message+'</p>');
+
+ window.console.error(error);
+ error = error || {};
+ var name = error.name || 'Runtime error';
+ var error_container = $('<div/>', {
+ 'class': 'facet-content facet-error'
+ }).appendTo($('.content').empty());
+ error_container.append('<h1>'+name+'</h1>');
+ var details = $('<div/>', {
+ 'class': 'error-details'
+ }).appendTo(error_container);
+
+ details.append('<p> Web UI got in unrecoverable state during "'+error.phase+'" phase.</p>');
+
+ if (error.results) {
+ details.append('<strong>Technical details:</strong>');
+ details.append('<p>'+JSON.stringify(error.results)+'</p>');
+ }
},
on_facet_change: function(event) {