X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Ferror.cpp;fp=source%2Fcore%2Ferror.cpp;h=727fa215adf3989b9f37c52f7fecae8c9f577f34;hb=521cf1db00f8ce2d9f9494dca503d6c17d89ac2f;hp=0000000000000000000000000000000000000000;hpb=80bbee2f401b4af71cb1b80508bdb0d2bb61fa40;p=libs%2Fcore.git diff --git a/source/core/error.cpp b/source/core/error.cpp new file mode 100644 index 0000000..727fa21 --- /dev/null +++ b/source/core/error.cpp @@ -0,0 +1,40 @@ +/* $Id$ + +This file is part of libmspcore +Copyright © 2006-2007 Mikko Rasa, Mikkosoft Productions +Distributed under the LGPL +*/ +#include +#include "backtrace.h" +#include "error.h" + +using namespace std; + +namespace Msp { + +Exception::Exception(const string &w_): + w(w_) +{ +#ifdef WITH_EXCEPTION_BACKTRACE + bt=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<