errors – Exceptions raised by the pymongo package

Exceptions raised by PyMongo.

exception pymongo.errors.AutoReconnect(message='', errors=None)

Raised when a connection to the database is lost and an attempt to auto-reconnect will be made.

In order to auto-reconnect you must handle this exception, recognizing that the operation which caused it has not necessarily succeeded. Future operations will attempt to open a new connection to the database (and will continue to raise this exception until the first successful connection is made).

exception pymongo.errors.CollectionInvalid

x.__init__(...) initializes x; see help(type(x)) for signature

exception pymongo.errors.ConfigurationError

x.__init__(...) initializes x; see help(type(x)) for signature

exception pymongo.errors.ConnectionFailure

x.__init__(...) initializes x; see help(type(x)) for signature

exception pymongo.errors.DuplicateKeyError(error, code=None)

Raised when a safe insert or update fails due to a duplicate key error.

Note

Requires server version >= 1.3.0

New in version 1.4.

exception pymongo.errors.ExceededMaxWaiters

x.__init__(...) initializes x; see help(type(x)) for signature

exception pymongo.errors.InvalidName

x.__init__(...) initializes x; see help(type(x)) for signature

exception pymongo.errors.InvalidOperation

x.__init__(...) initializes x; see help(type(x)) for signature

exception pymongo.errors.InvalidURI

x.__init__(...) initializes x; see help(type(x)) for signature

exception pymongo.errors.OperationFailure(error, code=None)

Raised when a database operation fails.

New in version 1.8: The code attribute.

exception pymongo.errors.PyMongoError

x.__init__(...) initializes x; see help(type(x)) for signature

exception pymongo.errors.TimeoutError(error, code=None)

Raised when a database operation times out.

New in version 1.8.

exception pymongo.errors.UnsupportedOption

x.__init__(...) initializes x; see help(type(x)) for signature

Previous topic

cursor – Tools for iterating over MongoDB query results

Next topic

master_slave_connection – Master-slave connection to MongoDB

This Page