aboutsummaryrefslogtreecommitdiffstats
path: root/lang/cpp/src/gpgrevokekeyeditinteractor.cpp
diff options
context:
space:
mode:
authorIngo Klöcker <[email protected]>2022-04-04 11:15:37 +0000
committerIngo Klöcker <[email protected]>2022-04-05 08:15:07 +0000
commitdb532eca8ebd64536985e7a40af22e803e3b3df9 (patch)
tree5354bbae8780d6f831c3b54f3a5760e8f2e832b6 /lang/cpp/src/gpgrevokekeyeditinteractor.cpp
parentcpp: Add internal utility function for splitting strings (diff)
downloadgpgme-db532eca8ebd64536985e7a40af22e803e3b3df9.tar.gz
gpgme-db532eca8ebd64536985e7a40af22e803e3b3df9.zip
cpp: Return actual error if revocation fails
* lang/cpp/src/editinteractor.cpp, lang/cpp/src/editinteractor.h (EditInteractor::parseStatusError): New. * lang/cpp/src/gpgrevokekeyeditinteractor.cpp (GpgRevokeKeyEditInteractor::Private::nextState): Handle status error. -- With this change the interactor returns a proper error like "Bad Passphrase" or "Empty Passphrase" instead of an unspecific "General Error" if a status error occurred. GnuPG-bug-id: 5904
Diffstat (limited to 'lang/cpp/src/gpgrevokekeyeditinteractor.cpp')
-rw-r--r--lang/cpp/src/gpgrevokekeyeditinteractor.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lang/cpp/src/gpgrevokekeyeditinteractor.cpp b/lang/cpp/src/gpgrevokekeyeditinteractor.cpp
index a90b5934..86b3c3c4 100644
--- a/lang/cpp/src/gpgrevokekeyeditinteractor.cpp
+++ b/lang/cpp/src/gpgrevokekeyeditinteractor.cpp
@@ -116,6 +116,10 @@ unsigned int GpgRevokeKeyEditInteractor::Private::nextState(unsigned int status,
return q->state();
}
+ if (status == GPGME_STATUS_ERROR) {
+ err = q->parseStatusError(args);
+ return ERROR;
+ }
switch (const auto state = q->state()) {
case START:
if (status == GPGME_STATUS_GET_LINE &&