'Request failed, process reply based on reason
@param binding: The binding to be used to process the reply.
@type binding: L{suds.bindings.binding.Binding}
@param error: The http error message
@type error: L{transport.TransportError}'

def failed(self, binding, error):

    (status, reason) = (error.httpcode, tostr(error))
    reply = error.fp.read()
    log.debug('http    failed:\n%s', reply)
    if (status == 500):
        if (len(reply) > 0):
            (r, p) = binding.get_fault(reply)
            self.last_received(r)
            return (status, p)
        else:
            return (status, None)
    if self.options.faults:
        raise Exception((status, reason))
    else:
        return (status, None)
