diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2019-01-24 14:59:21 +0100 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2019-01-25 14:04:26 +0100 |
commit | d1e68e97496d0541f3ddd0483f62e185e870c9e4 (patch) | |
tree | ffbed66169cc800bdb69f9e511d1ff32f8873c5b /openpgp-ffi | |
parent | eac75e99e14f8860aeee7574bdd01081b4782b02 (diff) |
openpgp-ffi: Improve error handling.
- In case of errors, set *tpk_out to None.
Diffstat (limited to 'openpgp-ffi')
-rw-r--r-- | openpgp-ffi/src/tpk.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/openpgp-ffi/src/tpk.rs b/openpgp-ffi/src/tpk.rs index be2bd56d..62f3f855 100644 --- a/openpgp-ffi/src/tpk.rs +++ b/openpgp-ffi/src/tpk.rs @@ -679,6 +679,9 @@ pub extern "system" fn pgp_tpk_builder_generate *revocation_out = box_raw!(revocation); Status::Success }, - Err(e) => ffi_try_status!(Err::<(), failure::Error>(e)), + Err(e) => { + *tpk_out = None; + ffi_try_status!(Err::<(), failure::Error>(e)) + }, } } |