summaryrefslogtreecommitdiff
path: root/src/bin/eolian_cxx
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2015-10-09 13:54:32 -0300
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2015-10-09 13:54:32 -0300
commit932b6e74635ede0bb1a1f8b86ebfc7efac724ef4 (patch)
tree5e474d77606e035b1a98ff0ecd91e9de3bfd6230 /src/bin/eolian_cxx
parent13606c46474364e9dafa7aa6c1addf3be89950ce (diff)
eolian-cxx: Fixed possible exception escaping main
Added try/catch around main to show the reason for the generation failure. @fix CID 1265600
Diffstat (limited to 'src/bin/eolian_cxx')
-rw-r--r--src/bin/eolian_cxx/eolian_cxx.cc19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/bin/eolian_cxx/eolian_cxx.cc b/src/bin/eolian_cxx/eolian_cxx.cc
index 38084f422c..cb33de4e53 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)
366 366
367int main(int argc, char **argv) 367int main(int argc, char **argv)
368{ 368{
369 efl::eina::eina_init eina_init; 369 try
370 efl::eolian::eolian_init eolian_init; 370 {
371 eolian_cxx::options_type opts = opts_get(argc, argv); 371 efl::eina::eina_init eina_init;
372 eolian_cxx::database_load(opts); 372 efl::eolian::eolian_init eolian_init;
373 eolian_cxx::run(opts); 373 eolian_cxx::options_type opts = opts_get(argc, argv);
374 eolian_cxx::database_load(opts);
375 eolian_cxx::run(opts);
376 }
377 catch(std::exception const& e)
378 {
379 std::cerr << "EOLCXX: Eolian C++ failed generation for the following reason: " << e.what() << std::endl;
380 std::cout << "EOLCXX: Eolian C++ failed generation for the following reason: " << e.what() << std::endl;
381 return -1;
382 }
374 return 0; 383 return 0;
375} 384}