aboutsummaryrefslogtreecommitdiffstats
path: root/lang/cpp
diff options
context:
space:
mode:
authorIngo Klöcker <[email protected]>2022-04-22 15:26:17 +0000
committerIngo Klöcker <[email protected]>2022-04-22 15:30:59 +0000
commit321c8a0254f4729ff1ffe56956fb049555272321 (patch)
tree0453884ca7b519c53ceb23a1334c05b1b8642302 /lang/cpp
parentdoc: Remove explanation about AM_PATH_GPGME_PTH for GNU Pth. (diff)
downloadgpgme-321c8a0254f4729ff1ffe56956fb049555272321.tar.gz
gpgme-321c8a0254f4729ff1ffe56956fb049555272321.zip
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
Diffstat (limited to 'lang/cpp')
-rw-r--r--lang/cpp/src/result.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/lang/cpp/src/result.h b/lang/cpp/src/result.h
index 5ed52a89..a587afbe 100644
--- a/lang/cpp/src/result.h
+++ b/lang/cpp/src/result.h
@@ -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;