From 318bd8297c9393aea3c406afe5b195f44fe9a50d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20L=C3=BChne?= Date: Sun, 12 Jun 2016 22:09:47 +0200 Subject: [PATCH] Disambiguation of parser and translation errors in plasp binary. --- apps/plasp-app/main.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/apps/plasp-app/main.cpp b/apps/plasp-app/main.cpp index bd6eee7..9d2ba93 100644 --- a/apps/plasp-app/main.cpp +++ b/apps/plasp-app/main.cpp @@ -9,6 +9,7 @@ #include #include #include +#include int main(int argc, char **argv) { @@ -115,6 +116,18 @@ int main(int argc, char **argv) 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) { std::cerr << "Error: " << e.what() << std::endl << std::endl;