From 932b6e74635ede0bb1a1f8b86ebfc7efac724ef4 Mon Sep 17 00:00:00 2001 From: Felipe Magno de Almeida Date: Fri, 9 Oct 2015 13:54:32 -0300 Subject: [PATCH] eolian-cxx: Fixed possible exception escaping main Added try/catch around main to show the reason for the generation failure. @fix CID 1265600 --- src/bin/eolian_cxx/eolian_cxx.cc | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/bin/eolian_cxx/eolian_cxx.cc b/src/bin/eolian_cxx/eolian_cxx.cc index 38084f4..cb33de4 100644 --- a/src/bin/eolian_cxx/eolian_cxx.cc +++ b/src/bin/eolian_cxx/eolian_cxx.cc @@ -366,10 +366,19 @@ opts_get(int argc, char **argv) int main(int argc, char **argv) { - efl::eina::eina_init eina_init; - efl::eolian::eolian_init eolian_init; - eolian_cxx::options_type opts = opts_get(argc, argv); - eolian_cxx::database_load(opts); - eolian_cxx::run(opts); + try + { + efl::eina::eina_init eina_init; + efl::eolian::eolian_init eolian_init; + eolian_cxx::options_type opts = opts_get(argc, argv); + eolian_cxx::database_load(opts); + eolian_cxx::run(opts); + } + catch(std::exception const& e) + { + std::cerr << "EOLCXX: Eolian C++ failed generation for the following reason: " << e.what() << std::endl; + std::cout << "EOLCXX: Eolian C++ failed generation for the following reason: " << e.what() << std::endl; + return -1; + } return 0; } -- 2.7.4