summaryrefslogtreecommitdiffstats
path: root/src/pgp
diff options
context:
space:
mode:
Diffstat (limited to 'src/pgp')
-rw-r--r--src/pgp/main.vala2
-rw-r--r--src/pgp/pgp-interface.vala6
-rw-r--r--src/pgp/pgp.vala6
3 files changed, 8 insertions, 6 deletions
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);