-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 1.1.8
-
Component/s: None
-
None
In bson.c, fromJson calls phongo_throw_exception with either a custom error message, or a generic "Error parsing JSON" message.
To determine whether or not to use a custom error message (bubbled up from mongoc) it checks whether a bson_error_t's message field is NULL. Since the message field is just an array, it is never NULL. This produces a warning on some compilers.
To check if the bson_error_t has an error message, error.code or error.domain should be checked instead.