GNOME Bugzilla – Bug 729015
Cannot throw error from callback
Last modified: 2018-01-27 11:57:08 UTC
I've got a callback function with a GError** as last arg and it returns an object or NULL if error is set. When I implement that callback in JS code and I do: throw new Error("plop"); The the gjs console prints: (gjs:29398): Gjs-WARNING **: JS ERROR: Error: plop And in the C code the the return value of the callback is NULL but the error is NULL as well. Note that the gir looks correct to me: <callback name="CMParamFilter" c:type="TpCMParamFilter" throws="1">
Yes, this is currently not implemented. I had some wip patches at some point, but they weren't really working. If you want to contribute, I can send you the old code...
This also needs work on the GI side of thing, see bug 729543.
Giovanni, I'd be interested in the old patches - would you like to post them here?
They are in bug 682701
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gjs/issues/85.