diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2018-03-15 12:13:04 +0100 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2018-03-15 12:13:04 +0100 |
commit | 8e7d1fb864520425006363fbfdff6b96a5015ed2 (patch) | |
tree | 75bd927c22936a51d2f7b3a8ab7bee7085926a79 /ffi/examples/keyserver.c | |
parent | dd257663217d6d2c098d5a57d8a3f8c5a830310f (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.c | 6 |
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) |