After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 729015 - Cannot throw error from callback
Cannot throw error from callback
Status: RESOLVED OBSOLETE
Product: gjs
Classification: Bindings
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gjs-maint
gjs-maint
Depends on: 729543
Blocks:
 
 
Reported: 2014-04-26 14:21 UTC by Xavier Claessens
Modified: 2018-01-27 11:57 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Xavier Claessens 2014-04-26 14:21:38 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">
Comment 1 Giovanni Campagna 2014-04-30 19:53:54 UTC
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...
Comment 2 Simon Feltman 2014-05-12 01:49:58 UTC
This also needs work on the GI side of thing, see bug 729543.
Comment 3 Philip Chimento 2016-11-17 08:07:55 UTC
Giovanni, I'd be interested in the old patches - would you like to post them here?
Comment 4 Giovanni Campagna 2016-11-22 23:54:26 UTC
They are in bug 682701
Comment 5 GNOME Infrastructure Team 2018-01-27 11:57:08 UTC
-- 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.