GNOME Bugzilla – Bug 730917
ParserError detected as normal enum instead of ErrorDomain
Last modified: 2014-05-29 09:00:12 UTC
The Vala bindings (which are autogenerated via introspection) seem to pick up the Json ParserError as an enum instead of ErrorDomain. Steps to reproduce: 1. Attempt to use try { ... } catch (Json.ParserError err) { ... } in Vala Results: Fails to compile with "clause must catch a valid error type, found `Json.ParserError' instead" Expected: Vala will discover the ErrorDomain through Introspection and allow it to be caught.
JsonParserError doesn't seem to be registered, that's probably the cause. The GIR doesn't include glib:error-domain, glib:type-name, or glib:get-type attributes.
Created attachment 277438 [details] [review] introspection: include json-enum-types.{c,h} in GIR
thanks for the patch. I ended up pushing something similar, but that uses the full path of the generated files to avoid issues with srcdir != builddir scenarios (like distcheck).
Created attachment 277440 [details] [review] build: Include enum-types.[ch] in the introspection sources Otherwise g-ir-scanner won't pick the types up, and will not notice that the error enumerations have an associated error domain.