title: How to catch message of finally exception clause in python?
body: <p>I know how to catch exceptions and print the message they returned:</p>
  
  <pre><code>class SelfDefinedException(Exception): pass
  
  try:
      message = "Hello World!"
      raise SelfDefinedException(message)
  except MyDefinedException, e:
      print "MyDefinedException", e
  </code></pre>
  
  <p>This works good so far.</p>
  
  <p>But how can I catch and print the message in a 'finally' clause?</p>
  
  <pre><code>class SelfDefinedException(Exception): pass
  
  try:
      message = "Hello World!"
      raise SelfDefinedException(message)
  except MyDefinedException, e:
      print "MyDefinedException", e
  finally:
      # What goes here? So I can see what went wrong?
  </code></pre>
  
  <p>From several answers I understand, that this is not possible. Is it ok to do something like this?</p>
  
  <pre><code>class SelfDefinedException(Exception): pass
  
  try:
      message = "Hello World!"
      raise SelfDefinedException(message)
  except MyDefinedException, e:
      print "MyDefinedException", e
  except Exception, e:
      # Hopefully catches all messages except for the one of MyDefinedException
      print "Unexpected Exception raised:", e
  </code></pre>