]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
dbusgen: Add mandatory "throws DBusError, IOError" to methods
authorRico Tzschichholz <ricotz@ubuntu.com>
Wed, 19 Sep 2018 13:07:00 +0000 (15:07 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sat, 29 Apr 2023 19:00:17 +0000 (21:00 +0200)
dbusgen/valadbusparser.vala
dbusgen/valadbusvariantmodule.vala

index 612f30cf90664014b87cc5a787224b0052931b50..08450d90adc0df37cf7dd0506bd1987556f69c88 100644 (file)
@@ -298,6 +298,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 ();
 
index 578c76b24b996a61a1380da1a4dfeade4f567bbc..df69a2c156ba4de6928bb21eee18368c17cfe12c 100644 (file)
@@ -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"));