]> git.tdb.fi Git - libs/datafile.git/blobdiff - source/dataerror.h
Exception rework for parser components
[libs/datafile.git] / source / dataerror.h
diff --git a/source/dataerror.h b/source/dataerror.h
new file mode 100644 (file)
index 0000000..7b53c65
--- /dev/null
@@ -0,0 +1,27 @@
+#ifndef MSP_DATAFILE_DATAERROR_H_
+#define MSP_DATAFILE_DATAERROR_H_
+
+#include <stdexcept>
+
+namespace Msp {
+namespace DataFile {
+
+class data_error: public std::runtime_error
+{
+private:
+       std::string source;
+       unsigned line;
+
+public:
+       data_error(const std::string &, unsigned, const std::string &);
+       data_error(const std::string &, unsigned, const std::exception &);
+       virtual ~data_error() throw() { }
+
+private:
+       std::string make_what(const std::string &, unsigned, const std::string &);
+};
+
+} // namespace DataFile
+} // namespace Msp
+
+#endif