Clean up exception story so that there is only one exception type and one thing the user needs to catch

This commit is contained in:
Jonathan Turner
2009-07-16 13:24:15 +00:00
parent 8dbb43f45f
commit aed493322b
4 changed files with 69 additions and 103 deletions

View File

@@ -44,12 +44,6 @@ int main(int argc, char *argv[]) {
}
}
}
catch (chaiscript::Parse_Error &pe) {
std::cout << pe.reason << " in " << pe.filename << " at " << pe.position.line << ", " << pe.position.column << std::endl;
}
catch (chaiscript::Eval_Error &ee) {
std::cout << ee.reason << std::endl;
}
catch (std::exception &e) {
std::cout << e.what() << std::endl;
}
@@ -65,22 +59,6 @@ int main(int argc, char *argv[]) {
try {
dispatchkit::Boxed_Value val = chai.evaluate_file(argv[i]);
}
catch (chaiscript::Parse_Error &pe) {
if (filename != std::string("__EVAL__")) {
std::cout << pe.reason << " in " << pe.filename << " at " << pe.position.line << ", " << pe.position.column << std::endl;
}
else {
std::cout << pe.reason << std::endl;
}
}
catch (chaiscript::Eval_Error &ee) {
if (filename != std::string("__EVAL__")) {
std::cout << ee.reason << " in '" << ee.location->filename << "' at " << ee.location->start.line << ", " << ee.location->start.column << std::endl;
}
else {
std::cout << ee.reason << std::endl;
}
}
catch (std::exception &e) {
std::cout << e.what() << std::endl;
}