Console: Add log support to network client (every client is a log target)
[senf.git] / Utils / Exception.cc
index 5e69277..f94be75 100644 (file)
@@ -44,6 +44,21 @@ prefix_ char const * senf::Exception::what()
     return message_.c_str();
 }
 
+///////////////////////////////////////////////////////////////////////////
+// senf::SystemException
+
+prefix_ void senf::SystemException::init(std::string const & descr, int code
+                                         _SENF_EXC_DEBUG_ARGS_ND)
+{
+    code_ = code;
+#   ifdef SENF_DEBUG
+    if (file && line)
+        (*this) << "Exception at " << file << ":" << line << "\n";
+#   endif
+    (*this) << "[" << errorString() << "]";
+    if (! descr.empty()) (*this) << " " << descr;
+}
+
 ///////////////////////////////cc.e////////////////////////////////////////
 #undef prefix_