1BSON_ERROR_T(3) libbson BSON_ERROR_T(3)
2
3
4
5BSON Error Encapsulation
6
8 #include <bson/bson.h>
9
10 typedef struct {
11 uint32_t domain;
12 uint32_t code;
13 char message[504];
14 } bson_error_t;
15
17 The bson_error_t structure is used as an out-parameter to pass error
18 information to the caller. It should be stack-allocated and does not
19 requiring freeing.
20
21 See Handling Errors.
22
24 bson_reader_t *reader;
25 bson_error_t error;
26
27 reader = bson_reader_new_from_file ("dump.bson", &error);
28 if (!reader) {
29 fprintf (
30 stderr, "ERROR: %d.%d: %s\n", error.domain, error.code, error.message);
31 }
32
34 MongoDB, Inc
35
37 2017-present, MongoDB, Inc
38
39
40
41
421.25.1 Nov 08, 2023 BSON_ERROR_T(3)