00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 """Exceptions raised by the :mod:`gridfs` package"""
00016
00017 from pymongo.errors import PyMongoError
00018
00019
00020 class GridFSError(PyMongoError):
00021 """Base class for all GridFS exceptions.
00022
00023 .. versionadded:: 1.5
00024 """
00025
00026
00027 class CorruptGridFile(GridFSError):
00028 """Raised when a file in :class:`~gridfs.GridFS` is malformed.
00029 """
00030
00031
00032 class NoFile(GridFSError):
00033 """Raised when trying to read from a non-existent file.
00034
00035 .. versionadded:: 1.6
00036 """
00037
00038
00039 class FileExists(GridFSError):
00040 """Raised when trying to create a file that already exists.
00041
00042 .. versionadded:: 1.7
00043 """
00044
00045
00046 class UnsupportedAPI(GridFSError):
00047 """Raised when trying to use the old GridFS API.
00048
00049 In version 1.6 of the PyMongo distribution there were backwards
00050 incompatible changes to the GridFS API. Upgrading shouldn't be
00051 difficult, but the old API is no longer supported (with no
00052 deprecation period). This exception will be raised when attempting
00053 to use unsupported constructs from the old API.
00054
00055 .. versionadded:: 1.6
00056 """