]> git.tdb.fi Git - libs/datafile.git/blobdiff - source/dataerror.cpp
Move all exception classes to a common header
[libs/datafile.git] / source / dataerror.cpp
diff --git a/source/dataerror.cpp b/source/dataerror.cpp
deleted file mode 100644 (file)
index b21b84f..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-#include <typeinfo>
-#include <msp/debug/demangle.h>
-#include <msp/strings/format.h>
-#include "dataerror.h"
-
-using namespace std;
-
-namespace Msp {
-namespace DataFile {
-
-data_error::data_error(const string &s, unsigned l, const string &w):
-       runtime_error(make_what(s, l, w)),
-       source(s),
-       line(l)
-{ }
-
-data_error::data_error(const string &s, unsigned l, const exception &e):
-       runtime_error(make_what(s, l, format("%s (%s)", Debug::demangle(typeid(e).name()), e.what()))),
-       source(s),
-       line(l)
-{ }
-
-string data_error::make_what(const string &s, unsigned l, const string &w)
-{
-       if(l)
-               return format("%s:%d: %s", s, l, w);
-       else
-               return format("%s: %s", s, w);
-}
-
-} // namespace DataFile
-} // namespace Msp