Move socket errors from the XML-RPC plugin to the client

This commit is contained in:
Rob Crittenden 2008-11-03 17:38:05 -05:00
parent a97f5d76d1
commit f131480643
2 changed files with 5 additions and 1 deletions

View File

@ -25,6 +25,7 @@ import re
import sys
import code
import optparse
import socket
import frontend
import errors
@ -377,6 +378,9 @@ class CLI(object):
if callable(cmd.output_for_cli):
cmd.output_for_cli(ret)
return 0
except socket.error, e:
print e[1]
return 1
except errors.GenericError, err:
code = getattr(err,'faultCode',None)
faultString = getattr(err,'faultString',None)

View File

@ -61,7 +61,7 @@ class xmlrpc(Backend):
try:
return command(*params)
except socket.error, e:
print e[1]
raise
except xmlrpclib.Fault, e:
err = errors.convertFault(e)
raise err