added catch handler for syntax error when processing file args, for a clear error message with line number included
This commit is contained in:
parent
372bc976a0
commit
9c4bd366b6
4
main.cpp
4
main.cpp
@ -77,6 +77,10 @@ int main(int argc, const char * argv[]) {
|
||||
done = false;
|
||||
std::ifstream file {argv[i]};
|
||||
proc.eval(file, done);
|
||||
} catch (const syntax_error& err) {
|
||||
std::cerr << "curly: syntax error in " << argv[i];
|
||||
std::cerr << ", at line " << err.lineno();
|
||||
std::cerr << ": " << err.what() << '\n';
|
||||
} catch (const std::runtime_error& ex) {
|
||||
std::cerr << "curly: " << ex.what() << '\n';
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user