diff options
author | Ingo Klöcker <[email protected]> | 2022-04-04 11:25:30 +0000 |
---|---|---|
committer | Ingo Klöcker <[email protected]> | 2022-04-05 08:17:39 +0000 |
commit | 28cdbfdccb347e1ef15f794d4afd36f9275f073c (patch) | |
tree | 8ddbbb2ec41096d2dc79a0b33fbb64eb9fff825d | |
parent | cpp: Return actual error if revocation fails (diff) | |
download | gpgme-28cdbfdccb347e1ef15f794d4afd36f9275f073c.tar.gz gpgme-28cdbfdccb347e1ef15f794d4afd36f9275f073c.zip |
cpp: Handle canceling of an edit operation
* lang/cpp/src/editinteractor.cpp
(CallbackHelper::edit_interactor_callback_impl): Check for error _or_
canceled state.
--
Without this canceling an edit operation resulted in a "General error".
GnuPG-bug-id: 5904
-rw-r--r-- | lang/cpp/src/editinteractor.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lang/cpp/src/editinteractor.cpp b/lang/cpp/src/editinteractor.cpp index 753c2b09..08cb1bc9 100644 --- a/lang/cpp/src/editinteractor.cpp +++ b/lang/cpp/src/editinteractor.cpp @@ -101,7 +101,7 @@ public: std::fprintf(ei->debug, "EditInteractor: %u -> nextState( %s, %s ) -> %u\n", oldState, status_to_string(status), args ? args : "<null>", ei->state); } - if (err) { + if (err || err.isCanceled()) { ei->state = oldState; goto error; } @@ -154,7 +154,7 @@ public: } error: - if (err) { + if (err || err.isCanceled()) { ei->error = err; ei->state = EditInteractor::ErrorState; } |