Open mxmlnkn opened 8 years ago
You could try setting the G_DEBUG environment variable to hide them?
The 'error' occurs when we're requesting the member of a JSON object but it doesn't exist which happens in sometimes, eg if we're trying to get the name of the game the other user is playing but they're not currently in a game, you'd get that message. Not as critical as the message makes it out to be though :)
that should never happen if you're wrapping each get in json_object_has_member()
, see: https://developer.gnome.org/json-glib/stable/json-glib-JSON-Object.html#json-object-has-member
it's not json-glib's error.
So does that mean this annoying and constant error in the terminal is fixable?
We could make a wrapper function that does the "has member" check before the "get member" call?
I wonder if it's also possible to override the current calls with a #define to do the same with fewer lines-of-code changes...
The following preprocessor macro seems to work for get_int_member But if only masks the error, relying on zero as default value and expecting the the calling code works properly if zero is returned for a non existing member.
#define json_object_get_int_member(JSON_OBJECT, MEMBER) (json_object_has_member(JSON_OBJECT, MEMBER) ? json_object_get_int_member(JSON_OBJECT, MEMBER) : 0)
@tripplet Thanks for the good news :)
I'm using release 1.6.1 64bit.
The plugin itself works without problems so far, but my
~/.xsession-errors
gets spammed with the error message from the title every 20 seconds. Is there some way to solve that error?