diff options
Diffstat (limited to 'lang/cpp/src/result.h')
-rw-r--r-- | lang/cpp/src/result.h | 8 |
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; |