title: How to show pymongo.errors.OperationFailure details?
body: <p>I am getting a pymongo OperationsFailure in python when writing to MongoDB. Is there a way to print out the detail or code attribute in addition to the traceback?</p>
  
  <p>Also see: <a href="http://api.mongodb.org/python/current/api/pymongo/errors.html#pymongo.errors.OperationFailure.details" rel="noreferrer">http://api.mongodb.org/python/current/api/pymongo/errors.html#pymongo.errors.OperationFailure.details</a></p>
  
  <p>So far I am using:</p>
  
  <pre><code>try:
    connection.test.foo.find_one()
  except pymongo.errors.OperationFailure:
    print "caught"
  </code></pre>