Disambiguation of parser and translation errors in plasp binary.

This commit is contained in:
Patrick Lühne 2016-06-12 22:09:47 +02:00
parent 0513b3aa0c
commit 318bd8297c

View File

@ -9,6 +9,7 @@
#include <plasp/pddl/TranslatorASP.h> #include <plasp/pddl/TranslatorASP.h>
#include <plasp/sas/Description.h> #include <plasp/sas/Description.h>
#include <plasp/sas/TranslatorASP.h> #include <plasp/sas/TranslatorASP.h>
#include <plasp/utils/TranslatorException.h>
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
@ -115,6 +116,18 @@ int main(int argc, char **argv)
translator.translate(std::cout); translator.translate(std::cout);
} }
} }
catch (const plasp::utils::ParserException &e)
{
std::cerr << "Parser error: " << e.what() << std::endl << std::endl;
printHelp();
return EXIT_FAILURE;
}
catch (const plasp::utils::TranslatorException &e)
{
std::cerr << "Translation error: " << e.what() << std::endl << std::endl;
printHelp();
return EXIT_FAILURE;
}
catch (const std::exception &e) catch (const std::exception &e)
{ {
std::cerr << "Error: " << e.what() << std::endl << std::endl; std::cerr << "Error: " << e.what() << std::endl << std::endl;