def failed(self, binding, error):
status, reason = (error.httpcode, tostr(error))<EOL>reply = error.fp.read()<EOL>log.debug('<STR_LIT>', reply)<EOL>if status == <NUM_LIT>:<EOL><INDENT>if len(reply) > <NUM_LIT:0>:<EOL><INDENT>r, p = binding.get_fault(reply)<EOL>self.last_received(r)<EOL>return (status, p)<EOL><DEDENT>else:<EOL><INDENT>return (status, None)<EOL><DEDENT><DEDENT>if self.options.faults:<EOL><INDENT>raise Exception((status, reason))<EOL><DEDENT>else:<EOL><INDENT>return (status, None)<EOL><DEDENT>
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}