Handle broken or incomplete views more gracefully
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
couchdb-glib |
New
|
Undecided
|
Unassigned |
Bug Description
malformed (or incomplete) views seem to confuse couchdb-glib which starts throwing lots of Critical messages like that:
(process:4377): Json-CRITICAL **: json_object_
(process:4377): Json-CRITICAL **: json_object_
(process:4377): GLib-CRITICAL **: g_str_has_prefix: assertion `str != NULL' failed
(process:4377): Json-CRITICAL **: json_object_
(process:4377): GLib-GObject-
(process:4377): Json-CRITICAL **: json_object_ref: assertion `object != NULL' failed
(process:4377): Json-CRITICAL **: json_object_
handle such case more gracefully.
Even after I've tweaked my code some more I still get following messages:
(process:4001): Json-CRITICAL **: json_object_ get_string_ member: assertion `node != NULL' failed
(process:4001): GLib-CRITICAL **: g_str_has_prefix: assertion `str != NULL' failed
(process:4001): GLib-GObject- CRITICAL **: g_object_ref: assertion `G_IS_OBJECT (object)' failed
The request sent to couchdb looks like this: 127.0.0. 1:5984/ kangaroo/ _design/ channel/ _view/all_ channels? key=["http:// planet. ubuntu. com/"]
http://
view is: [doc.gobject. homepage] , doc);
function(doc) {
if (doc.type == "channel")
emit(
}
and the Json Document that couchdb returns: 2fe958dd1050006 1f9", planet. ubuntu. com/"
"value" : {
"_id" : "124ea9f5391113 2fe958dd1050006 1f9",
"_rev" : "1-1a216d57f81a 2a833298ffaed26 ea33c",
"type" : "channel",
"gobject" : {
" title": "Planet Ubuntu",
" homepage" : "http:// planet. ubuntu. com/",
" description" : "(...)",
" image": null,
" language" : "en",
" category" : null,
" copyright" : null,
" editor" : null,
" webmaster" : null,
" generator" : null
{
"total_rows": 1,
"offset": 0,
"rows": [
{
"id": "124ea9f5391113
"key": [
"http://
],
}
}
}
]
}