.\" This manpage is Copyright (C) 2016 MongoDB, Inc. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.3 .\" or any later version published by the Free Software Foundation; .\" with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. .\" A copy of the license is included in the section entitled "GNU .\" Free Documentation License". .\" .TH "HANDLING_ERRORS" "3" "2016\(hy10\(hy12" "libbson" .SH NAME Handling_Errors \- 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. .SH "DESCRIPTION" Many libbson functions report errors by returning .B NULL or \(hy1 and filling out a .B bson_error_t structure with an error domain, error code, and message. .IP \[bu] 2 .B error.domain names the subsystem that generated the error. .IP \[bu] 2 .B error.code is a domain\(hyspecific error type. .IP \[bu] 2 .B error.message describes the error. Some error codes overlap with others; always check both the domain and code to determine the type of error. .TP .B .B None .B BSON_JSON_ERROR_READ_CORRUPT_JS .B bson_json_reader_t tried to parse invalid MongoDB Extended JSON. .LP .TP .B .B BSON_JSON_ERROR_READ_INVALID_PARAM Tried to parse a valid JSON document that is invalid as MongoDBExtended JSON. .LP .TP .B .B BSON_JSON_ERROR_READ_CB_FAILURE An internal callback failure during JSON parsing. .LP .TP .B .B None .B BSON_ERROR_READER_BADFD .B bson_json_reader_new_from_file could not open the file. .LP .B .SH COLOPHON This page is part of libbson. Please report any bugs at https://jira.mongodb.org/browse/CDRIVER.