def FaultFromException(ex, inheader, tb=None, actor=None):
tracetext = None<EOL>if tb:<EOL><INDENT>try:<EOL><INDENT>lines = '<STR_LIT:\n>'.join(['<STR_LIT>' % (name, line, func)<EOL>for name, line, func, text in traceback.extract_tb(tb)])<EOL><DEDENT>except:<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>tracetext = lines<EOL><DEDENT><DEDENT>exceptionName = "<STR_LIT>"<EOL>try:<EOL><INDENT>exceptionName = "<STR_LIT::>".join([ex.__module__, ex.__class__.__name__])<EOL><DEDENT>except: pass<EOL>elt = ZSIFaultDetail(string=exceptionName + "<STR_LIT:\n>" + str(ex), trace=tracetext)<EOL>if inheader:<EOL><INDENT>detail, headerdetail = None, elt<EOL><DEDENT>else:<EOL><INDENT>detail, headerdetail = elt, None<EOL><DEDENT>return Fault(Fault.Server, '<STR_LIT>',<EOL>actor, detail, headerdetail)<EOL>
Return a Fault object created from a Python exception.

    <SOAP-ENV:Fault>
      <faultcode>SOAP-ENV:Server</faultcode>
      <faultstring>Processing Failure</faultstring>
      <detail>
        <ZSI:FaultDetail>
          <ZSI:string></ZSI:string>
          <ZSI:trace></ZSI:trace>
        </ZSI:FaultDetail>
      </detail>
    </SOAP-ENV:Fault>