X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fexcept.cpp;h=90deb4071b68983d5f2c487fee8a2192f1bb42af;hb=fcd7272c28b6da5a68d41e5aac7be1dfd2eeab78;hp=4b6e4657a4b89833a373f506ec5782e1fcd24728;hpb=9de64375e03b24ea46d36cec222150754e3818cb;p=libs%2Fcore.git diff --git a/source/core/except.cpp b/source/core/except.cpp index 4b6e465..90deb40 100644 --- a/source/core/except.cpp +++ b/source/core/except.cpp @@ -1,44 +1,62 @@ /* $Id$ This file is part of libmspcore -Copyright © 2006-2007 Mikko Rasa, Mikkosoft Productions +Copyright © 2006-2008 Mikko Rasa, Mikkosoft Productions Distributed under the LGPL */ + #include +#include +#ifdef WIN32 +#include +#endif #include "except.h" using namespace std; namespace Msp { -Exception::Exception(const string &w_): - w(w_) +Exception::Exception(const string &w): + wot(w) { #ifdef WITH_EXCEPTION_BACKTRACE bt=Debug::Backtrace::create(); #endif } +Exception &Exception::at(const std::string &w) throw() +{ + wer=w; + wot=wer+": "+wot; + return *this; +} + + SystemError::SystemError(const string &w_, int e): Exception(build_what(w_, e)), err(e) { } -KeyError::KeyError(const string &w_, const string &k): - Exception(w_+" ("+k+")"), - key(k) -{ } - string SystemError::build_what(const string &w, int e) { ostringstream buf; buf<