autfilt: diagnose non-existant files
* src/bin/autfilt.cc: Catch exception. * src/tgbatest/hoaparse.test: Test it.
This commit is contained in:
parent
e7e21ae58f
commit
a9fa7d33c5
2 changed files with 13 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue