title: How do I raise a SOAP Fault with a structured detail element in Spyne?
body: <p>The <a href="http://spyne.io/docs/2.10/manual/03_types.html#fault" rel="nofollow">Spyne manual</a> points out that the right way to create SOAP Faults with Spyne is to raise instances of <code>spyne.model.fault.Fault</code> (or your own subclass):</p>
  
  <pre><code>@add_metaclass(ComplexModelMeta)
  class Fault(ComplexModelBase, Exception):
      # ...
  </code></pre>
  
  <p>I'm trying to understand why it subclasses <code>ComplexModelBase</code>. My initial assumption was that I declare the elements I want to go into the SOAP Fault's <code>&lt;detail&gt;</code> element in my <code>Fault</code> subclass, like so:</p>
  
  <pre><code>class MyApplicationError(Fault):
      __namespace__ = 'http://myapplication.com/ns'
      _type_info = [
          ('reason', Unicode),
      ]
  </code></pre>
  
  <p>However, when actually raising this exception, it looks like I have to pass a plain dict into the <code>detail</code> parameter of the constructor.</p>
  
  <p>What is the best practice for filling the <code>detail</code> with a structured set of data? Do I even declare this structure in my <code>Fault</code> subclass?<br>
  If yes, how do I fill it? If not, why does <code>Fault</code> subclass <code>ComplexModelBase</code>?</p>