Put exception handling back into plasp binary for convenient use.

This commit is contained in:
Patrick Lühne 2016-06-10 17:12:23 +02:00
parent 34a413cf05
commit f6cfc55e21

View File

@ -62,6 +62,8 @@ int main(int argc, char **argv)
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
try
{
plasp::utils::Parser parser; plasp::utils::Parser parser;
parser.setCaseSensitive(false); parser.setCaseSensitive(false);
@ -107,6 +109,13 @@ int main(int argc, char **argv)
const auto sasTranslator = plasp::sas::TranslatorASP(sasDescription); const auto sasTranslator = plasp::sas::TranslatorASP(sasDescription);
sasTranslator.translate(std::cout); sasTranslator.translate(std::cout);
} }
}
catch (const std::exception &e)
{
std::cerr << "Error: " << e.what() << std::endl << std::endl;
printHelp();
return EXIT_FAILURE;
}
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }