summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2013-08-22 13:48:44 +0200
committerPetr Viktorin <pviktori@redhat.com>2013-08-26 13:05:36 +0200
commit34342b9a972a3a454b979dc64d0a510c5af24894 (patch)
tree697d2cb778db5b5643cc715548c09a08c9ae7d0a
parentedf92f765099366ae4e0b28e2aeaa54b7af92712 (diff)
downloadfreeipa-34342b9a972a3a454b979dc64d0a510c5af24894.tar.gz
freeipa-34342b9a972a3a454b979dc64d0a510c5af24894.tar.xz
freeipa-34342b9a972a3a454b979dc64d0a510c5af24894.zip
Show human-readable error name in error dialog title
Fixes RPC server's JSON encoding of exception's name. It allows to show the name in Web UI's error dialog title.
-rw-r--r--install/ui/src/freeipa/ipa.js3
-rw-r--r--ipaserver/rpcserver.py2
2 files changed, 3 insertions, 2 deletions
diff --git a/install/ui/src/freeipa/ipa.js b/install/ui/src/freeipa/ipa.js
index 8d54b66e0..0e9fdefb9 100644
--- a/install/ui/src/freeipa/ipa.js
+++ b/install/ui/src/freeipa/ipa.js
@@ -733,7 +733,8 @@ IPA.command = function(spec) {
} else if (data.error) {
// error_handler() calls IPA.hide_activity_icon()
error_handler.call(this, xhr, text_status, /* error_thrown */ {
- name: text.get('@i18n:errors.ipa_error', 'IPA Error')+' '+data.error.code,
+ name: text.get('@i18n:errors.ipa_error', 'IPA Error') + ' ' +
+ data.error.code + ': ' + data.error.name,
code: data.error.code,
message: data.error.message,
data: data
diff --git a/ipaserver/rpcserver.py b/ipaserver/rpcserver.py
index eb9b0734a..0ec7b02d2 100644
--- a/ipaserver/rpcserver.py
+++ b/ipaserver/rpcserver.py
@@ -516,7 +516,7 @@ class jsonserver(WSGIExecutioner, HTTP_Status):
error = dict(
code=error.errno,
message=error.strerror,
- name=error.__class__.__name__,
+ name=unicode(error.__class__.__name__),
)
principal = getattr(context, 'principal', 'UNKNOWN')
response = dict(