[vala/wip/dbusgen: 40/40] dbusgen: Add mandatory "throws DBusError, IOError" to methods



commit db941c7acc1984b4f4c8590a3ad777a1dc40d0d9
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Wed Sep 19 15:07:00 2018 +0200

    dbusgen: Add mandatory "throws DBusError, IOError" to methods

 dbusgen/valadbusparser.vala        | 2 ++
 dbusgen/valadbusvariantmodule.vala | 4 ++++
 2 files changed, 6 insertions(+)
---
diff --git a/dbusgen/valadbusparser.vala b/dbusgen/valadbusparser.vala
index eed0197d1..19e284bf1 100644
--- a/dbusgen/valadbusparser.vala
+++ b/dbusgen/valadbusparser.vala
@@ -300,6 +300,8 @@ public class Vala.DBusParser : CodeVisitor {
                current_iface.add_method ((Method)current_method);
                ((Method)current_method).is_abstract = true;
                ((Method)current_method).access = SymbolAccessibility.PUBLIC;
+               ((Method)current_method).add_error_type (dbus_module.gio_error_type);
+               ((Method)current_method).add_error_type (dbus_module.gdbus_error_type);
 
                next ();
 
diff --git a/dbusgen/valadbusvariantmodule.vala b/dbusgen/valadbusvariantmodule.vala
index 578c76b24..df69a2c15 100644
--- a/dbusgen/valadbusvariantmodule.vala
+++ b/dbusgen/valadbusvariantmodule.vala
@@ -49,6 +49,8 @@ public class Vala.DBusVariantModule {
        public TypeSymbol gtype_type;
        public TypeSymbol gobject_type;
        public ErrorType gerror_type;
+       public ErrorType gdbus_error_type;
+       public ErrorType gio_error_type;
        public ObjectType dictionary_type;
        public ObjectType gvariant_type;
        public Struct gvalue_type;
@@ -90,6 +92,8 @@ public class Vala.DBusVariantModule {
                gtype_type = (TypeSymbol) glib_ns.scope.lookup ("Type");
                gobject_type = (TypeSymbol) glib_ns.scope.lookup ("Object");
                gerror_type = new ErrorType (null, null);
+               gio_error_type = new ErrorType ((ErrorDomain) glib_ns.scope.lookup ("DBusError"), null);
+               gdbus_error_type = new ErrorType ((ErrorDomain) glib_ns.scope.lookup ("IOError"), null);
 
                gvalue_type = (Struct) glib_ns.scope.lookup ("Value");
                gvariant_type = new ObjectType ((Class) glib_ns.scope.lookup ("Variant"));


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]