Streamlined SystemException definition and usage
[senf.git] / Utils / Exception.cc
index 5e69277..e23357f 100644 (file)
@@ -44,6 +44,16 @@ prefix_ char const * senf::Exception::what()
     return message_.c_str();
 }
 
+///////////////////////////////////////////////////////////////////////////
+// senf::SystemException
+
+prefix_ void senf::SystemException::init(std::string const & descr, int code)
+{
+    code_ = code;
+    (*this) << "[" << errorString() << "]";
+    if (! descr.empty()) (*this) << " " << descr;
+}
+
 ///////////////////////////////cc.e////////////////////////////////////////
 #undef prefix_