title: Get the full exception type/message and stack trace
body: <p>I've written an API which returns Json in the following format...</p>
  
  <pre><code>{"Success": true, Result: {...}}
  
  {"Success": false, ExceptionId: "(some uuid)"}
  </code></pre>
  
  <p>The exceptions are logged. This is fine in principle for allowing someone to discuss an error without us ever telling them what it is (as a security measure). During debugging I also want to output the error message to stop me having to refer to a database all the time.</p>
  
  <p>As things stand, the problem is getting useful information from the exception (either to return or log in the db)</p>
  
  <p>I'm doing something like this...</p>
  
  <pre><code>try:
      Ret['Result'] = &lt;Blah&gt;
      Ret['Success'] = True
  except Exception as e:
      # ... Logging/ExceptionId
      if Settings.DebugMode: 
          Ret['Exception'] = str(e)
  </code></pre>
  
  <p>If I put a breakpoint on the last line and inspect <code>e</code> in eclipse's watch window, I get <code>KeyError: 'Something'</code>, but <code>str(e)</code> results in <code>'Something'</code> which is very unhelpful.</p>
  
  <p>I've googled and I can't find any way to get a proper message from an exception. Apparently there used to be a <code>.message</code> in v&lt;2.4 but that's no help to me in 3.3</p>
  
  <p>As an alternative, I tried doing:</p>
  
  <pre><code>Ret['Exception'] = str(type(e)) + ": " + str(e)
  </code></pre>
  
  <p>Which resulted in <code>&lt;class 'KeyError'&gt;: 'job'</code> which is a little closer but it's starting to feel more and more hackish.</p>
  
  <p>I also want to include a Stack Trace but have had even less luck there - I can get the <code>__traceback__</code> but of course it's not serializable and calling <code>str()</code> on it just results in a description of the object eg <code>&lt;traceback object at 0x0000000004024E48&gt;</code></p>
  
  <p>How can I get a decent/comprehensive error message?</p>