X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Utils%2FException.cci;h=6f7e13dc08ebf1c27bc44766b761d05d44393d30;hb=724c67ba71f9a232b53a4508ef3ab8575be29514;hp=e7a9c53987163b9b8fa91800fbb57dddc78d5e11;hpb=034f9bec0a66d26314fb6ebc83dedf1618a2c19d;p=senf.git diff --git a/Utils/Exception.cci b/Utils/Exception.cci index e7a9c53..6f7e13d 100644 --- a/Utils/Exception.cci +++ b/Utils/Exception.cci @@ -28,12 +28,50 @@ ///////////////////////////////cci.p/////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// +// senf::ExceptionMixin + +prefix_ senf::ExceptionMixin::ExceptionMixin(std::string const & description) + : what_(description) +{ +#ifdef SENF_DEBUG + addBacktrace(); +#endif +} + +prefix_ std::string senf::ExceptionMixin::message() + const +{ +#ifdef SENF_DEBUG + return what_.substr(excLen_); +#else + return what_; +#endif +} + +prefix_ std::string senf::ExceptionMixin::backtrace() + const +{ +#ifdef SENF_DEBUG + return what_.substr(0,excLen_-4); +#else + return ""; +#endif +} + +prefix_ void senf::ExceptionMixin::append(std::string text) +{ + what_ += text; +} + +/////////////////////////////////////////////////////////////////////////// // senf::Exception + prefix_ senf::Exception::Exception(std::string const & description) - : message_(description) + : ExceptionMixin(description) {} /////////////////////////////////////////////////////////////////////////// +// senf::SystemException prefix_ senf::SystemException::SystemException(std::string const & descr _SENF_EXC_DEBUG_ARGS_ND) {