diff options
author | Endi S. Dewata <edewata@redhat.com> | 2011-06-03 10:49:42 -0500 |
---|---|---|
committer | Adam Young <ayoung@redhat.com> | 2011-06-03 15:49:23 -0400 |
commit | 403ed477b56695576e74f8fda1c9fc8b1df53700 (patch) | |
tree | 896a0cfbb247dc50fd191091d3827d066f79742c /install/ui | |
parent | 34c5d996d760abeaede782253931ed7bc36320cc (diff) | |
download | freeipa-403ed477b56695576e74f8fda1c9fc8b1df53700.tar.gz freeipa-403ed477b56695576e74f8fda1c9fc8b1df53700.tar.xz freeipa-403ed477b56695576e74f8fda1c9fc8b1df53700.zip |
Fixed blank dialog box on internal error.
Previously when an internal error occurs on the server the UI will
display a blank error dialog box. To fix the problem the string
message thrown by Ajax has been converted into an object containing
the error message.
Ticket #1280
Diffstat (limited to 'install/ui')
-rw-r--r-- | install/ui/ipa.js | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/install/ui/ipa.js b/install/ui/ipa.js index 9f75f4936..4f194739b 100644 --- a/install/ui/ipa.js +++ b/install/ui/ipa.js @@ -287,13 +287,6 @@ IPA.command = function(spec) { IPA.hide_activity_icon(); - if (!error_thrown) { - error_thrown = { - name: xhr.responseText || 'Unknown Error', - message: xhr.statusText || 'Unknown Error' - }; - } - if (xhr.status === 401) { error_thrown = {}; // error_thrown is string error_thrown.name = 'Kerberos ticket no longer valid.'; @@ -307,6 +300,18 @@ IPA.command = function(spec) { "<a href='/ipa/config/unauthorized.html'>"+ "follow these directions</a> to configure your browser."; } + + } else if (!error_thrown) { + error_thrown = { + name: xhr.responseText || 'Unknown Error', + message: xhr.statusText || 'Unknown Error' + }; + + } else if (typeof error_thrown == 'string') { + error_thrown = { + name: error_thrown, + message: error_thrown + }; } if (that.retry) { @@ -320,13 +325,12 @@ IPA.command = function(spec) { function success_handler(data, text_status, xhr) { if (!data) { - IPA.hide_activity_icon(); - var error_thrown = { + // error_handler() calls IPA.hide_activity_icon() + error_handler.call(this, xhr, text_status, /* error_thrown */ { name: 'HTTP Error '+xhr.status, url: this.url, - message: data ? xhr.statusText : "No response" - }; - dialog_open.call(this, xhr, text_status, error_thrown); + message: data ? xhr.statusText : 'No response' + }); } else if (data.error) { // error_handler() calls IPA.hide_activity_icon() |