Commit a9fa7d33 authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

autfilt: diagnose non-existant files

* src/bin/autfilt.cc: Catch exception.
* src/tgbatest/hoaparse.test: Test it.
parent e7e21ae5
......@@ -391,7 +391,14 @@ main(int argc, char** argv)
post.set_level(level);
hoa_processor processor(post);
if (processor.run())
return 2;
try
{
if (processor.run())
return 2;
}
catch (const std::runtime_error& e)
{
error(2, 0, "%s", e.what());
}
return 0;
}
......@@ -717,3 +717,7 @@ input:4.7-242: unclosed string
input:4.7-242: syntax error, unexpected end of file, expecting string
autfilt: failed to read automaton from input
EOF
expecterr non-existant<<EOF
autfilt: Cannot open file non-existant
EOF
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment