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 625837 - Add support for parsing error domains from GIR files
Add support for parsing error domains from GIR files
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Bindings
0.9.x
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks: 625652
 
 
Reported: 2010-08-02 14:56 UTC by Philip Withnall
Modified: 2010-08-12 19:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add support for parsing error domains from GIR files (5.54 KB, patch)
2010-08-02 14:56 UTC, Philip Withnall
none Details | Review

Description Philip Withnall 2010-08-02 14:56:49 UTC
Created attachment 166980 [details] [review]
Add support for parsing error domains from GIR files

Attached is an *unfinished* patch to add support for parsing error domains from GIR files. It converts every <enumeration> element which has a glib:error-quark attribute to a Vala errordomain rather than a normal enum.

Unfortunately, it doesn't quite work. When creating the telepathy-glib bindings (specifically, when parsing the TpError enumeration shown below) it gives the following error:

error: The type name `Error' could not be found
Generation failed: 1 error(s), 0 warning(s)

I have no idea how to fix this. The error isn't the most helpful either. I hope it's not much work to fix up the patch, since the bulk of the work is done and it's probably just some type registration issue in the parser which I haven't figured out. :-(

Here's the GIR extract for TpError:

<enumeration name="Error" c:type="TpError" glib:error-quark="tp_error_quark">
  <doc xml:whitespace="preserve">Enumerated type representing the Telepathy D-Bus errors.</doc>
  <member name="network_error" value="0" c:identifier="TP_ERROR_NETWORK_ERROR"/>
  <member name="not_implemented" value="1" c:identifier="TP_ERROR_NOT_IMPLEMENTED"/>
  <member name="invalid_argument" value="2" c:identifier="TP_ERROR_INVALID_ARGUMENT"/>
</enumeration>
Comment 1 Jürg Billeter 2010-08-12 19:26:17 UTC
commit 648cf84c988cb456d98637601dcac096ba125ac3
Author: Philip Withnall <philip.withnall@collabora.co.uk>
Date:   Mon Aug 2 15:51:46 2010 +0100

    girparser: Add support for parsing error domains
    
    Fixes bug 625837.