X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fexcept.cpp;h=d3929f6c7a8592fb6cf26fef9956c9e916f7965d;hb=HEAD;hp=eea692e06fd6ee042a3732a52f4ee5fcb96812a8;hpb=ed78b585cfc4ecb44972e346857e887b183fd7a7;p=libs%2Fdatafile.git diff --git a/source/except.cpp b/source/except.cpp index eea692e..c698d83 100644 --- a/source/except.cpp +++ b/source/except.cpp @@ -1,4 +1,3 @@ -#include #include #include #include "except.h" @@ -20,6 +19,12 @@ data_error::data_error(const string &s, unsigned l, const exception &e): line(l) { } +data_error::data_error(const string &s, unsigned l, const data_error &e): + runtime_error(format("%s\n%s", e.what(), make_what(s, l, "Referenced here"))), + source(s), + line(l) +{ } + string data_error::make_what(const string &s, unsigned l, const string &w) { if(l) @@ -48,5 +53,20 @@ nesting_error::nesting_error(const string &w): logic_error(w) { } + +unknown_keyword::unknown_keyword(const string &k): + runtime_error(k) +{ } + + +invalid_signature::invalid_signature(const string &k, const string &s): + runtime_error(format("%s %s", k, s)) +{ } + + +no_collection::no_collection(const type_info &t): + runtime_error(Debug::demangle(t.name())) +{ } + } // namespace DataFile } // namespace Msp