Logo Search packages:      
Sourcecode: hellanzb version File versions  Download package

def Hellanzb::HellaXMLRPC::errHandler (   remoteCall,
  failure 
)

generic xml rpc client err back -- handle errors, and possibly spawn a post processor
thread 

Definition at line 398 of file __init__.py.

00398                                    :
    """ generic xml rpc client err back -- handle errors, and possibly spawn a post processor
    thread """
    #debug('errHandler, class: ' + str(failure.value.__class__) + ' args: ' + \
    #      str(failure.value.args), failure)

    err = failure.value
    if isinstance(err, ConnectionRefusedError):

        error('Unable to connect to XMLRPC server,\nerror: ' + str(err) + '\n' + \
             'The hellanzb queue daemon @ ' + Hellanzb.serverUrl + ' probably isn\'t running')

        # By default, post process in the already running hellanzb. otherwise do the work
        # in this current process, and exit
        if remoteCall.funcName == 'process':
            info('\nProcessing locally (-L) instead..')
            if RemoteCall.options.postProcessDir != None:
                from Hellanzb.Daemon import postProcess
                return postProcess(RemoteCall.options)
            else:
                error(sys.argv[0] + ': error: process option requires a value')
        
    elif isinstance(err, ValueError):
        if len(err.args) == 2 and err.args[0] == '401':
            error('Incorrect Hellanzb.XMLRPC_PASSWORD: ' + err.args[1] + ' (XMLRPC server: ' + \
                 Hellanzb.serverUrl + ')')
        elif len(err.args) == 2 and err.args[0] == '405':
            error('XMLRPC server: ' + Hellanzb.serverUrl + ' did not understand command: ' + \
                 remoteCall.funcName + \
                 ' -- this server is probably not the hellanzb XML RPC server!')
        else:
            error('Unexpected XMLRPC problem: ' + str(err))
            
    elif isinstance(err, Fault):
        if err.faultCode == 8001:
            error('Invalid command: ' + remoteCall.funcName + ' (XMLRPC server: ' + Hellanzb.serverUrl + \
                 ') faultString: ' + err.faultString)
        elif err.faultCode == 8002:
            error('Invalid arguments? for call: ' + remoteCall.funcName + ' (XMLRPC server: ' + \
                 Hellanzb.serverUrl + ') faultString: ' + err.faultString)
        elif err.faultCode in (9001,):
            # hellanzb error
            error(str(err.faultString))
        else:
            error('Unexpected XMLRPC response: ' + str(err) + ' : ' + getStack(err))

    elif isinstance(err, DNSLookupError):
        error('No address associated with hostname (dns lookup failed)\nurl: ' + Hellanzb.serverUrl)
        pass
            
    reactor.stop()

class RemoteCallArg:


Generated by  Doxygen 1.6.0   Back to index