aboutsummaryrefslogtreecommitdiffstats
path: root/lang/cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lang/cpp')
-rw-r--r--lang/cpp/src/context.cpp7
-rw-r--r--lang/cpp/src/error.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/lang/cpp/src/context.cpp b/lang/cpp/src/context.cpp
index 99e354df..4882c80c 100644
--- a/lang/cpp/src/context.cpp
+++ b/lang/cpp/src/context.cpp
@@ -130,6 +130,13 @@ const char *Error::asString() const
return mMessage.c_str();
}
+std::string Error::asStdString() const
+{
+ std::string message;
+ format_error(static_cast<gpgme_error_t>(mErr), message);
+ return message;
+}
+
int Error::code() const
{
return gpgme_err_code(mErr);
diff --git a/lang/cpp/src/error.h b/lang/cpp/src/error.h
index d1367046..bc970e36 100644
--- a/lang/cpp/src/error.h
+++ b/lang/cpp/src/error.h
@@ -48,6 +48,7 @@ public:
const char *source() const;
const char *asString() const;
+ std::string asStdString() const;
int code() const;
int sourceID() const;