aboutsummaryrefslogtreecommitdiff
path: root/crypto-vala/src/error.vala
diff options
context:
space:
mode:
authorMarvin W <git@larma.de>2021-05-14 19:26:05 +0200
committerMarvin W <git@larma.de>2021-05-14 19:26:05 +0200
commit6399892bf2c53fc3701438c752718638baff8e27 (patch)
treef2d60570240109e5f65f1250807ce90812b484f2 /crypto-vala/src/error.vala
parentbec73ed3714fc89627392b1dfc74d1b919dbe355 (diff)
downloaddino-6399892bf2c53fc3701438c752718638baff8e27.tar.gz
dino-6399892bf2c53fc3701438c752718638baff8e27.zip
Move crypto-vala to shared library
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