From f466538a3527cd539c732d3abee481fa7a34fc2f Mon Sep 17 00:00:00 2001 From: Sebastian Reichel Date: Thu, 28 Jun 2018 01:03:02 +0200 Subject: all: Add DBusError to avoid warnings with valac 0.40 --- src/pgp/main.vala | 2 ++ src/pgp/pgp-interface.vala | 6 +++--- src/pgp/pgp.vala | 6 +++--- 3 files changed, 8 insertions(+), 6 deletions(-) (limited to 'src/pgp') diff --git a/src/pgp/main.vala b/src/pgp/main.vala index c866c7b..332bcd5 100644 --- a/src/pgp/main.vala +++ b/src/pgp/main.vala @@ -24,6 +24,8 @@ public static int main(string[] args) { try { cfg = Bus.get_proxy_sync(BusType.SYSTEM, "io.mainframe.shopsystem.Config", "/io/mainframe/shopsystem/config"); pgp = new PGPKeyArchive(cfg.get_string("PGP", "keyring")); + } catch(DBusError e) { + error("DBusError: %s\n", e.message); } catch(IOError e) { error("IOError: %s\n", e.message); } catch(KeyFileError e) { diff --git a/src/pgp/pgp-interface.vala b/src/pgp/pgp-interface.vala index 62bfe67..2621fae 100644 --- a/src/pgp/pgp-interface.vala +++ b/src/pgp/pgp-interface.vala @@ -15,7 +15,7 @@ [DBus (name = "io.mainframe.shopsystem.PGP")] public interface PGP : Object { - public abstract string[] import_archive(uint8[] data) throws IOError; - public abstract string[] list_keys() throws IOError; - public abstract string get_key(string fingerprint) throws IOError; + public abstract string[] import_archive(uint8[] data) throws IOError, DBusError; + public abstract string[] list_keys() throws IOError, DBusError; + public abstract string get_key(string fingerprint) throws IOError, DBusError; } diff --git a/src/pgp/pgp.vala b/src/pgp/pgp.vala index bb48c61..560b00f 100644 --- a/src/pgp/pgp.vala +++ b/src/pgp/pgp.vala @@ -42,7 +42,7 @@ public class PGPKeyArchive { gpg.set_armor(true); } - public string[] import_archive(uint8[] data) { + public string[] import_archive(uint8[] data) throws DBusError, IOError { string[] result = {}; unowned Archive.Entry entry; var archive = new Archive.Read(); @@ -93,7 +93,7 @@ public class PGPKeyArchive { return result; } - public string[] list_keys() { + public string[] list_keys() throws DBusError, IOError { string[] result = {}; GPG.Key key; @@ -108,7 +108,7 @@ public class PGPKeyArchive { return result; } - public string get_key(string fingerprint) { + public string get_key(string fingerprint) throws DBusError, IOError { GPG.Data keydata; GPG.Data.create(out keydata); -- cgit v1.2.3