summaryrefslogtreecommitdiffstats
path: root/ffi/examples/keyserver.c
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2018-03-15 12:13:04 +0100
committerJustus Winter <justus@sequoia-pgp.org>2018-03-15 12:13:04 +0100
commit8e7d1fb864520425006363fbfdff6b96a5015ed2 (patch)
tree75bd927c22936a51d2f7b3a8ab7bee7085926a79 /ffi/examples/keyserver.c
parentdd257663217d6d2c098d5a57d8a3f8c5a830310f (diff)
ffi: Improve error reporting when creating contexts.
- Usually, we report complex errors by attaching them to the ffi context. However, when we create the contexts, there is no context to attach the error to. Therefore, we add an explicit error argument here.
Diffstat (limited to 'ffi/examples/keyserver.c')
-rw-r--r--ffi/examples/keyserver.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ffi/examples/keyserver.c b/ffi/examples/keyserver.c
index 343ee163..fbc6fe9a 100644
--- a/ffi/examples/keyserver.c
+++ b/ffi/examples/keyserver.c
@@ -8,14 +8,16 @@
int
main (int argc, char **argv)
{
+ sq_error_t err;
sq_context_t ctx;
sq_keyid_t id;
sq_keyserver_t ks;
sq_tpk_t tpk;
- ctx = sq_context_new ("org.sequoia-pgp.example");
+ ctx = sq_context_new ("org.sequoia-pgp.example", &err);
if (ctx == NULL)
- error (1, 0, "Initializing sequoia failed.");
+ error (1, 0, "Initializing sequoia failed: %s",
+ sq_error_string (err));
ks = sq_keyserver_sks_pool (ctx);
if (ks == NULL)