X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Utils%2FException.cc;h=2798216eae2924ade2438900a268d5c55ddcd297;hb=0fff17bd2bcdbb1e91e216bf6e1bebc414713548;hp=a5349100137cb5434ff65ec61c6565953b3bbd3c;hpb=c52cd7d87dbb525c1267aad27391b8b7365dbb57;p=senf.git diff --git a/Utils/Exception.cc b/Utils/Exception.cc index a534910..2798216 100644 --- a/Utils/Exception.cc +++ b/Utils/Exception.cc @@ -27,14 +27,24 @@ // Custom includes #include +#include #define prefix_ ///////////////////////////////cc.p//////////////////////////////////////// -prefix_ char const * satcom::lib::SystemException::what() +prefix_ void senf::SystemException::init() +{ + std::stringstream s; + if (where) + s << where << ": "; + s << "(" << err << ") " << std::strerror(err); + buffer_ = s.str(); +} + +prefix_ char const * senf::SystemException::what() const throw() { - return std::strerror(this->err); + return buffer_.c_str(); } ///////////////////////////////cc.e//////////////////////////////////////// @@ -43,5 +53,5 @@ prefix_ char const * satcom::lib::SystemException::what() // Local Variables: // mode: c++ -// c-file-style: "satcom" +// c-file-style: "senf" // End: