1 #include <msp/debug/demangle.h>
2 #include <msp/strings/format.h>
10 data_error::data_error(const string &s, unsigned l, const string &w):
11 runtime_error(make_what(s, l, w)),
16 data_error::data_error(const string &s, unsigned l, const exception &e):
17 runtime_error(make_what(s, l, format("%s (%s)", Debug::demangle(typeid(e).name()), e.what()))),
22 data_error::data_error(const string &s, unsigned l, const data_error &e):
23 runtime_error(format("%s\n%s", e.what(), make_what(s, l, "Referenced here"))),
28 string data_error::make_what(const string &s, unsigned l, const string &w)
31 return format("%s:%d: %s", s, l, w);
33 return format("%s: %s", s, w);
37 parse_error::parse_error(const string &t):
38 runtime_error(t.empty() ? "at end of input" : format("after '%s'", t))
42 syntax_error::syntax_error(const string &t):
43 runtime_error(t.empty() ? "at end of input" : format("at '%s'", t))
47 bad_definition::bad_definition(const string &w):
52 nesting_error::nesting_error(const string &w):
57 unknown_keyword::unknown_keyword(const string &k):
62 invalid_signature::invalid_signature(const string &k, const string &s):
63 runtime_error(format("%s %s", k, s))
67 no_collection::no_collection(const type_info &t):
68 runtime_error(Debug::demangle(t.name()))
71 } // namespace DataFile