summaryrefslogtreecommitdiff
path: root/klm/util/exception.cc
diff options
context:
space:
mode:
Diffstat (limited to 'klm/util/exception.cc')
-rw-r--r--klm/util/exception.cc16
1 files changed, 15 insertions, 1 deletions
diff --git a/klm/util/exception.cc b/klm/util/exception.cc
index de6dd43c..077405f4 100644
--- a/klm/util/exception.cc
+++ b/klm/util/exception.cc
@@ -8,6 +8,20 @@ namespace util {
Exception::Exception() throw() {}
Exception::~Exception() throw() {}
+Exception::Exception(const Exception &from) : std::exception() {
+ stream_.str(from.stream_.str());
+}
+
+Exception &Exception::operator=(const Exception &from) {
+ stream_.str(from.stream_.str());
+ return *this;
+}
+
+const char *Exception::what() const throw() {
+ text_ = stream_.str();
+ return text_.c_str();
+}
+
namespace {
// The XOPEN version.
const char *HandleStrerror(int ret, const char *buf) {
@@ -16,7 +30,7 @@ const char *HandleStrerror(int ret, const char *buf) {
}
// The GNU version.
-const char *HandleStrerror(const char *ret, const char *buf) {
+const char *HandleStrerror(const char *ret, const char * /*buf*/) {
return ret;
}
} // namespace