diff options
author | Pavel Vomacka <pvomacka@redhat.com> | 2016-08-24 18:55:18 +0200 |
---|---|---|
committer | Martin Basti <mbasti@redhat.com> | 2016-09-15 16:46:11 +0200 |
commit | b18a35145df92522ae990e020513d1a77e311493 (patch) | |
tree | c09a2d68cb5653da437e56db93067ef982b2b698 /install/ui/src | |
parent | 3e4740f788aee00ae03a61d39238f605779fcece (diff) | |
download | freeipa-b18a35145df92522ae990e020513d1a77e311493.tar.gz freeipa-b18a35145df92522ae990e020513d1a77e311493.tar.xz freeipa-b18a35145df92522ae990e020513d1a77e311493.zip |
WebUI: Add handling for HTTP error 404
In case that API is not accessible the 404 error is thrown. There was error dialog
with almost no information. The new dialog says what error is there and what can be
the main cause of the error.
https://fedorahosted.org/freeipa/ticket/4821
Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
Diffstat (limited to 'install/ui/src')
-rw-r--r-- | install/ui/src/freeipa/rpc.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/install/ui/src/freeipa/rpc.js b/install/ui/src/freeipa/rpc.js index e2257a915..65bed7766 100644 --- a/install/ui/src/freeipa/rpc.js +++ b/install/ui/src/freeipa/rpc.js @@ -124,7 +124,8 @@ rpc.command = function(spec) { /** @property {ordered_map.<number,string>} error_messages Error messages map */ that.error_messages = $.ordered_map({ - 911: 'Missing HTTP referer. You have to configure your browser to send HTTP referer header.' + 911: 'Missing HTTP referer. You have to configure your browser to send HTTP referer header.', + 404: 'Cannot connect to the server, please check API accesibility (certificate, API, proxy, etc.)' }); /** @@ -317,6 +318,12 @@ rpc.command = function(spec) { if (xhr.status === 401) { error_handler_auth(xhr, text_status, error_thrown); return; + } else if (xhr.status === 404) { + error_thrown = { + code: xhr.status, + name: xhr.responseText || text.get('@i18n:errors.http_error', + 'HTTP Error')+' '+xhr.status + }; } else if (!error_thrown) { error_thrown = { name: xhr.responseText || text.get('@i18n:errors.unknown_error', 'Unknown Error'), |