cpp: Allow changing the error of a result

* lang/cpp/src/result.h (class Result): Add member function setError.
--

This can be used to replace the error of a result with a more suitable
error.

GnuPG-bug-id: 5939
This commit is contained in:
Ingo Klöcker 2022-04-22 17:26:17 +02:00
parent b10791b055
commit 321c8a0254
2 changed files with 9 additions and 0 deletions

1
NEWS
View File

@ -11,6 +11,7 @@ Noteworthy changes in version 1.17.2 (unreleased)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cpp: RevocationReason NEW.
cpp: GpgRevokeKeyEditInteractor NEW.
cpp: Result::setError NEW.
qt: RevokeKeyJob NEW.
qt: Protocol::revokeKeyJob NEW.

View File

@ -50,6 +50,14 @@ public:
{
return mError;
}
/**
* Replaces the error set during construction with \p error.
* Use with care, e.g. to set a more suitable error.
*/
void setError(const Error &error)
{
mError = error;
}
protected:
Error mError;