cpp: Handle status errors in the base edit interactor

* lang/cpp/src/editinteractor.cpp (edit_interactor_callback_impl):
Handle status errors.
* lang/cpp/src/gpgrevokekeyeditinteractor.cpp
(GpgRevokeKeyEditInteractor::Private::nextState): Remove handling of
status errors.
--

With this change status errors are handled for all interactors. In
particular, this makes all edit interactors handle canceled password
prompts correctly.

GnuPG-bug-id: 6305
This commit is contained in:
Ingo Klöcker 2022-12-08 15:27:22 +01:00
parent c419376b85
commit e7953dcf13
No known key found for this signature in database
GPG Key ID: F5A5D1692277A1E9
2 changed files with 3 additions and 4 deletions

View File

@ -99,6 +99,9 @@ public:
if (ei->q->needsNoResponse(status)) { if (ei->q->needsNoResponse(status)) {
// keep state // keep state
} else if (status == GPGME_STATUS_ERROR) {
err = ei->q->parseStatusError(args);
ei->state = EditInteractor::ErrorState;
} else { } else {
ei->state = ei->q->nextState(status, args, err); ei->state = ei->q->nextState(status, args, err);
} }

View File

@ -112,10 +112,6 @@ unsigned int GpgRevokeKeyEditInteractor::Private::nextState(unsigned int status,
static const Error GENERAL_ERROR = Error::fromCode(GPG_ERR_GENERAL); static const Error GENERAL_ERROR = Error::fromCode(GPG_ERR_GENERAL);
if (status == GPGME_STATUS_ERROR) {
err = q->parseStatusError(args);
return ERROR;
}
switch (const auto state = q->state()) { switch (const auto state = q->state()) {
case START: case START:
if (status == GPGME_STATUS_GET_LINE && if (status == GPGME_STATUS_GET_LINE &&