aboutsummaryrefslogtreecommitdiff
path: root/crypto-vala/src/error.vala
diff options
context:
space:
mode:
Diffstat (limited to 'crypto-vala/src/error.vala')
-rw-r--r--crypto-vala/src/error.vala15
1 files changed, 15 insertions, 0 deletions
diff --git a/crypto-vala/src/error.vala b/crypto-vala/src/error.vala
new file mode 100644
index 00000000..5007d725
--- /dev/null
+++ b/crypto-vala/src/error.vala
@@ -0,0 +1,15 @@
+namespace Crypto {
+
+public errordomain Error {
+ ILLEGAL_ARGUMENTS,
+ GCRYPT,
+ AUTHENTICATION_FAILED,
+ UNKNOWN
+}
+
+internal void may_throw_gcrypt_error(GCrypt.Error e) throws Error {
+ if (((int)e) != 0) {
+ throw new Crypto.Error.GCRYPT(e.to_string());
+ }
+}
+} \ No newline at end of file