bson_errors3
Handling errors
Overview
Many libbson functions report errors by returning NULL or -1 and filling out a bson_error_t structure with an error domain, error code, and message.
- •
-
error.domainnames the subsystem that generated the error.
- •
-
error.codeis a domain-specific error type.
- •
-
error.messagedescribes the error.
Some error codes overlap with others; always check both the domain and code to determine the type of error.
| BSON_ERROR_JSON | BSON_JSON_ERROR_READ_CORRUPT_JS BSON_JSON_ERROR_READ_INVALID_PARAM BSON_JSON_ERROR_READ_CB_FAILURE | bson_json_reader_t tried to parse invalid MongoDB Extended JSON. Tried to parse a valid JSON document that is invalid as MongoDBExtended JSON. An internal callback failure during JSON parsing. |
| BSON_ERROR_READER | BSON_ERROR_READER_BADFD | bson_json_reader_new_from_file() could not open the file. |
History
- Debian 12 (Bookworm): the text shown here
- Debian 11 (Bullseye)
- Debian 10 (Buster)
- Debian 9 (Stretch)