diff options
author | Adam Young <ayoung@redhat.com> | 2011-06-15 14:34:54 -0400 |
---|---|---|
committer | Endi S. Dewata <edewata@redhat.com> | 2011-06-20 18:46:48 +0000 |
commit | 38f4368e3031d7baab7b07972be2932e990d3694 (patch) | |
tree | 56858404a042bd98007451f874e2a4a1b1545de3 /install | |
parent | ceb7c9cf4b4f72df36891ed77f79a3bc2fb2fde7 (diff) | |
download | freeipa-38f4368e3031d7baab7b07972be2932e990d3694.tar.gz freeipa-38f4368e3031d7baab7b07972be2932e990d3694.tar.xz freeipa-38f4368e3031d7baab7b07972be2932e990d3694.zip |
no redirect on unknown error If the error name is indicates a server wide error, do not attempt to redirect.
this variation has a whitelist of errors on which to redirect.
https://fedorahosted.org/freeipa/ticket/1281
Diffstat (limited to 'install')
-rw-r--r-- | install/ui/entity.js | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/install/ui/entity.js b/install/ui/entity.js index c6d46ab74..7e600e4e7 100644 --- a/install/ui/entity.js +++ b/install/ui/entity.js @@ -136,20 +136,33 @@ IPA.facet = function (spec) { details.append('<p>'+error_thrown.message+'</p>'); }; + that.redirect_on_error = function(){ + var current_entity = that.entity; + while (current_entity.containing_entity){ + current_entity = current_entity.containing_entity; + } + IPA.nav.show_page( + current_entity.name, + that.entity.redirect_facet); + }; + + var redirect_errors = + ["IPA Error 4001"]; + that.on_error = function(xhr, text_status, error_thrown) { + + /*If the error is in talking to the server, don't attempt to redirect, + as there is nothing any other facet can do either. */ if (that.entity.redirect_facet ) { - var current_entity = that.entity; - while (current_entity.containing_entity){ - current_entity = current_entity.containing_entity; + for (var i =0; i < redirect_errors.length; i += 1){ + if (error_thrown.name === redirect_errors[i]){ + that.redirect_on_error(); + return; + } } - IPA.nav.show_page( - current_entity.name, - that.entity.redirect_facet); - return; - }else{ - that.report_error(error_thrown); } + that.report_error(error_thrown); }; |