X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Utils%2FException.cci;h=6f7e13dc08ebf1c27bc44766b761d05d44393d30;hb=b1f9349b1f3521d58cbef52ead0f2e5303a58c9e;hp=b745f8056ee7e6625eb5cda9faf2434322629092;hpb=17d44437f7fb8ee68a96ed55fc327c746c161142;p=senf.git diff --git a/Utils/Exception.cci b/Utils/Exception.cci index b745f80..6f7e13d 100644 --- a/Utils/Exception.cci +++ b/Utils/Exception.cci @@ -28,23 +28,48 @@ ///////////////////////////////cci.p/////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// -// senf::Exception +// senf::ExceptionMixin -prefix_ senf::Exception::Exception(std::string const & description) - : message_(description) -{} +prefix_ senf::ExceptionMixin::ExceptionMixin(std::string const & description) + : what_(description) +{ +#ifdef SENF_DEBUG + addBacktrace(); +#endif +} -prefix_ std::string const & senf::Exception::message() +prefix_ std::string senf::ExceptionMixin::message() const { - return message_; +#ifdef SENF_DEBUG + return what_.substr(excLen_); +#else + return what_; +#endif } -prefix_ void senf::Exception::append(std::string text) +prefix_ std::string senf::ExceptionMixin::backtrace() + const { - message_ += text; +#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) + : ExceptionMixin(description) +{} + /////////////////////////////////////////////////////////////////////////// // senf::SystemException