Classes used to represent exceptions. When using the MetagenomeDB API it is recommended to use the try/except syntax to catch such exceptions and display meaningful error messages. For example:
import MetagenomeDB as mdb
try:
mdb.connect(database = "My database")
# here we catch any exception related to the database connection
except mdb.ConnectionError as msg:
print "Connection error: %s" % msg
# here we catch any other exception thrown by the toolkit
except mdb.MetagenomeDBerror as msg:
print "General error: %s" % msg
(see the Python documentation about handling exceptions)
Exception that is raised when failing to connect to a MongoDB server.
Exception that is raised when attempting to add an object in the database while a formerly imported object already exists with the same values for one or more unique properties.
Exception thrown when an object is created with incorrect initial parameters.
Base class for all MetagenomeDB exceptions.
Exception thrown when an operation is performed on an uncommitted object that requires this object to be committed.