X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fcore%2Fexcept.cpp;fp=source%2Fcore%2Fexcept.cpp;h=245bc0502c0481b36a218531bb14bff93c2fbc13;hp=0000000000000000000000000000000000000000;hb=c13c5d2e330e4cee177c1fd8e0b6153c7e2503e4;hpb=55a79fbe96a87183fa4e11049eb161943636b1dd diff --git a/source/core/except.cpp b/source/core/except.cpp new file mode 100644 index 0000000..245bc05 --- /dev/null +++ b/source/core/except.cpp @@ -0,0 +1,39 @@ +/* $Id$ + +This file is part of libmspcore +Copyright © 2006-2007 Mikko Rasa, Mikkosoft Productions +Distributed under the LGPL +*/ +#include +#include "except.h" + +using namespace std; + +namespace Msp { + +Exception::Exception(const string &w_): + w(w_) +{ +#ifdef WITH_EXCEPTION_BACKTRACE + bt=Debug::Backtrace::create(); +#endif +} + +SystemError::SystemError(const string &w_, int e): + Exception(build_what(w_, e)), + err(e) +{ } + +string SystemError::build_what(const string &w, int e) +{ + ostringstream buf; + buf<