More xmlrpc tweaks: xmlserver.execute() now logs non-public exceptions; xmlclient.forward() now handles socket error; fixed some Python 2.4 problems in lite-xmlrpc2.py

This commit is contained in:
Jason Gerard DeRose
2009-01-22 17:03:48 -07:00
committed by Rob Crittenden
parent 24b6cb89d4
commit 833088955c
6 changed files with 58 additions and 39 deletions

View File

@@ -370,27 +370,19 @@ class NetworkError(PublicError):
For example:
>>> raise NetworkError(uri='ldap://localhost:389')
>>> raise NetworkError(uri='ldap://localhost:389', error='Connection refused')
Traceback (most recent call last):
...
NetworkError: cannot connect to 'ldap://localhost:389'
NetworkError: cannot connect to 'ldap://localhost:389': Connection refused
"""
errno = 907
format = _('cannot connect to %(uri)r')
format = _('cannot connect to %(uri)r: %(error)s')
class ServerNetworkError(PublicError):
"""
**908** Raised when client catches a `NetworkError` from server.
For example:
>>> e = NetworkError(uri='ldap://localhost:389')
>>> raise ServerNetworkError(error=e.message, server='https://localhost')
Traceback (most recent call last):
...
ServerNetworkError: error on server 'https://localhost': cannot connect to 'ldap://localhost:389'
"""
errno = 908