diff options
author | saturneric <[email protected]> | 2024-07-29 11:38:29 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2024-07-29 11:38:29 +0000 |
commit | a0a8c4b995fa1b5a0354673bfc99c51179b1ea6a (patch) | |
tree | 6b3a088d3dae607f622469540868fbd95ea6c5f2 /src | |
parent | fix: untrack GFSDKBuildInfo.h (diff) | |
download | GpgFrontend-a0a8c4b995fa1b5a0354673bfc99c51179b1ea6a.tar.gz GpgFrontend-a0a8c4b995fa1b5a0354673bfc99c51179b1ea6a.zip |
fix: exporter should return err properly
Diffstat (limited to 'src')
-rw-r--r-- | src/core/function/gpg/GpgKeyImportExporter.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/function/gpg/GpgKeyImportExporter.cpp b/src/core/function/gpg/GpgKeyImportExporter.cpp index 2b4448de..b9875131 100644 --- a/src/core/function/gpg/GpgKeyImportExporter.cpp +++ b/src/core/function/gpg/GpgKeyImportExporter.cpp @@ -91,7 +91,7 @@ auto GpgKeyImportExporter::ExportKey(const GpgKey& key, bool secret, bool ascii, GpgData data_out; auto* ctx = ascii ? ctx_.DefaultContext() : ctx_.BinaryContext(); auto err = gpgme_op_export_keys(ctx, keys_array.data(), mode, data_out); - if (gpgme_err_code(err) != GPG_ERR_NO_ERROR) return {}; + if (gpgme_err_code(err) != GPG_ERR_NO_ERROR) return {err, {}}; return {err, data_out.Read2GFBuffer()}; } @@ -122,7 +122,7 @@ void GpgKeyImportExporter::ExportKeys(const KeyArgsList& keys, bool secret, GpgData data_out; auto* ctx = ascii ? ctx_.DefaultContext() : ctx_.BinaryContext(); auto err = gpgme_op_export_keys(ctx, keys_array.data(), mode, data_out); - if (gpgme_err_code(err) != GPG_ERR_NO_ERROR) return {}; + if (gpgme_err_code(err) != GPG_ERR_NO_ERROR) return err; data_object->Swap({data_out.Read2GFBuffer()}); return err; @@ -152,7 +152,7 @@ void GpgKeyImportExporter::ExportAllKeys(const KeyArgsList& keys, bool secret, GpgData data_out; auto* ctx = ascii ? ctx_.DefaultContext() : ctx_.BinaryContext(); auto err = gpgme_op_export_keys(ctx, keys_array.data(), mode, data_out); - if (gpgme_err_code(err) != GPG_ERR_NO_ERROR) return {}; + if (gpgme_err_code(err) != GPG_ERR_NO_ERROR) return err; auto buffer = data_out.Read2GFBuffer(); @@ -163,7 +163,7 @@ void GpgKeyImportExporter::ExportAllKeys(const KeyArgsList& keys, bool secret, GpgData data_out_secret; auto err = gpgme_op_export_keys(ctx, keys_array.data(), mode, data_out_secret); - if (gpgme_err_code(err) != GPG_ERR_NO_ERROR) return {}; + if (gpgme_err_code(err) != GPG_ERR_NO_ERROR) return err; buffer.Append(data_out_secret.Read2GFBuffer()); } |