errors – Exceptions raised by the bson package — PyMongo 2.5 documentation

### Navigation

- index
- modules |
- next |
- previous |
- PyMongo 2.5 documentation »
- API Documentation »
- `bson` – BSON (Binary JSON) Encoding and Decoding »

# `errors` – Exceptions raised by the `bson` package

Exceptions raised by the BSON package.

exception `bson.errors.``BSONError`

  Base class for all BSON exceptions.

exception `bson.errors.``InvalidBSON`

  Raised when trying to create a BSON object from invalid data.

exception `bson.errors.``InvalidDocument`

  Raised when trying to create a BSON object from an invalid document.

exception `bson.errors.``InvalidId`

  Raised when trying to create an ObjectId from invalid data.

exception `bson.errors.``InvalidStringData`

  Raised when trying to encode a string containing non-UTF8 data.

### Navigation

- index
- modules |
- next |
- previous |
- PyMongo 2.5 documentation »
- API Documentation »
- `bson` – BSON (Binary JSON) Encoding and Decoding »