summaryrefslogtreecommitdiffstats
path: root/ipalib/rpc.py
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2009-07-10 15:33:07 -0400
committerRob Crittenden <rcritten@redhat.com>2009-07-15 08:59:58 -0400
commit904e55540438cfd88507fa747daa585605b90bdb (patch)
treebde943973aa64ff8525c5f120551968b54013397 /ipalib/rpc.py
parent017f236d6ac5ee434ce716a8187bc610f88943b8 (diff)
downloadfreeipa-904e55540438cfd88507fa747daa585605b90bdb.tar.gz
freeipa-904e55540438cfd88507fa747daa585605b90bdb.tar.xz
freeipa-904e55540438cfd88507fa747daa585605b90bdb.zip
Catch and handle HTTP exceptions (like 401, 404, etc)
Diffstat (limited to 'ipalib/rpc.py')
-rw-r--r--ipalib/rpc.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/ipalib/rpc.py b/ipalib/rpc.py
index 6ac0cfa83..6d8093a13 100644
--- a/ipalib/rpc.py
+++ b/ipalib/rpc.py
@@ -35,7 +35,7 @@ import threading
import socket
import os
import errno
-from xmlrpclib import Binary, Fault, dumps, loads, ServerProxy, Transport
+from xmlrpclib import Binary, Fault, dumps, loads, ServerProxy, Transport, ProtocolError
import kerberos
from ipalib.backend import Connectible
from ipalib.errors import public_errors, PublicError, UnknownError, NetworkError
@@ -418,3 +418,5 @@ class xmlclient(Connectible):
)
except socket.error, e:
raise NetworkError(uri=self.env.xmlrpc_uri, error=e.args[1])
+ except ProtocolError, e:
+ raise NetworkError(uri=self.env.xmlrpc_uri, error=e.errmsg)